FUNCTION_BLOCK SMC_Interpolator
This function block is used to convert a continuous path described by SMC_GEOINFO objects into discrete path position points taking into account a defined velocity profile and time pattern. Afterwards, these position points will typically be transformed by the IEC-program (e.g. to drive-axis-positions) and sent to the drives.
Note
At the end of a path run, the input path queue is empty. If you want to process the same outline once again, you either have to transform the CNC program via decoder and path preprocessing modules to a SMC_OUTQUEUE structure, or you have to use the function block SMC_RestoreQueue (also part of SM3_CNC). This is only possible if the path queue is big enough to hold the complete path.
InOut:
Scope |
Name |
Type |
Initial |
Comment |
Input |
bExecute |
BOOL |
FALSE |
Execution starts on the rising edge. |
poqDataIn |
POINTER TO SMC_OUTQUEUE |
This variable points to the SMC_OUTQUEUE structure object, which contains the SMC_GEOINFO objects of the path; typically it points to the output poqDataOut of SMC_CheckVelocities . |
||
bSlow_Stop |
BOOL |
FALSE |
If this variable is set to FALSE, the path will be passed non-stop. Otherwise, the SMC_Interpolator will be caused to reduce the velocity to 0 according to the defined velocity profile (byVelMode), and the maximum delay of the current SMC_GEOINFO object (dDecel, see below) and to wait until bSlow_Stop will be reset to FALSE. |
|
bEmergency_Stop |
BOOL |
FALSE |
As soon as this input gets TRUE, the SMC_Interpolator will cause an immediate stop, this means that the position will be retained. Hence, the velocity will be set to 0 immediately. |
|
bWaitAtNextStop |
BOOL |
FALSE |
As long as this variable is FALSE (default), the path is passed non-stop. Otherwise, the SMC_Interpolator will be caused to retain the position at the next regular stop this means at position points where the velocity is 0, typically at path angles and to pause until bWaitAtNextStop will be reset to FALSE. |
|
dOverride |
LREAL |
1 |
This variable can be used to handle the override. The value of dOverride is not allowed to be less than 0.01. The scheduled velocity of the particular objects will get scaled by dOverride; thus the scheduled velocity can be increased resp. reduced in online mode. For example dOverride=1 (default) effects that the programmed scheduled velocities will be executed, whereas dOverride=2 would double them. Please regard: The override can be modified at any time, but the modification will only be applied, if no acceleration or deceleration is currently in progress. |
|
iVelMode |
TRAPEZOID |
This input defines the velocity profile as defined in SMC_INT_VELMODE. |
||
dwIpoTime |
DWORD |
0 |
This variable has to be set for each call. It represents the cycle time in μsec. |
|
dLastWayPos |
LREAL |
0 |
This input allows the user to measure the stretch of the path that is racked out by the interpolator. Output dWayPos is the sum of dLastWayPos and the distance covered within the current cycle. If dLastWayPos is set equal to output dWayPos, dWayPos will always be incremented by the current path segment and the result will be the total length of the path travelled. dLastWayPos can be (re)set to 0 or to a different value at any time. |
|
bAbort |
BOOL |
FALSE |
This input set to TRUE will abort the function block. |
|
bSingleStep |
BOOL |
FALSE |
This input effects that the interpolator will stop at the transition between two path objects (also at transitions with identical tangent) for the duration of one cycle. If bSingleStep is set to TRUE during the move, the interpolator will stop at the end of that object, that can be reached without exceeding the scheduled deceleration value. If the interpolator should stop at the next possible stop position (i.e. at points where the velocity is 0), bWaitAtNextStop must be used. |
|
bAcknM |
BOOL |
FALSE |
This input can be used to acknowledge an M-function. If the input is TRUE, the output wM will be cleared and the path processing will be continued. |
|
bQuick_Stop |
BOOL |
FALSE |
If this input is TRUE, the interpolator will reduce the velocity to zero, until bQuick_Stop is reset to FALSE. The reduction is done according to the defined velocity profile (byVelMode) and the deceleration given by the maximum of dQuickDeceleration and the delay currently programmed in the path. If a quadratic velocity mode is used, then the jerk is limited by max(dJerkMax, dQuickStopJerk). |
|
dQuickDeceleration |
LREAL |
Deceleration value used for bQuick_Stop |
||
dJerkMax |
LREAL |
Magnitude of the maximum allowed jerk: It's only used for the quadratic velocity modes. It must be positive and cannot be changed while the interpolator is running. |
||
dQuickStopJerk |
LREAL |
The magnitude of the jerk is used by a quick stop for ramping down the acceleration if one of the quadratic velocity modes is selected. |
||
bSuppressSystemMFunctions |
BOOL |
If this option is set, then the output wM will not be set for internal M-functions created by G75 or G4 commands. |
||
Output |
bDone |
BOOL |
FALSE |
This variable will be set to TRUE as soon as the input data (poqDataIn) has been processed completely. The function block will not perform any further actions until a reset is done. If input bExecute is FALSE, bDone will be reset to FALSE. |
bBusy |
BOOL |
FALSE |
TRUE while execution of function block is not finished |
|
bError |
BOOL |
FALSE |
Signals that an error has occurred within the function block |
|
wErrorID |
SMC_ERROR |
SMC_NO_ERROR |
Error identification |
|
piSetPosition |
It reflects the calculated set position and contains the cartesian coordinates of the next position as well as the state of the additional axis. SMC_POSINFO |
|||
iStatus |
IPO_INIT |
This enumeration variable reflects the current status of the function block defined in SMC_INT_STATUS . Possible states:
|
||
bWorking |
BOOL |
FALSE |
This output is intended to be connected to input bEnable of SMC_ControlAxisByPos . It will be TRUE if (and only if) the processing of the list has been started and not yet finished |
|
iActObjectSourceNo |
DINT |
-1 |
Value of member iSourceLine_No of active SMC_GEOINFO object of poqDataIn-queue. (bWorking = FALSE), the value is set to "-1". |
|
dActObjectLength |
LREAL |
The length of the current object; valid if bWorking = TRUE. |
||
dActObjectLengthRemaining |
LREAL |
The remaning length of the current object; valid if bWorking = TRUE. |
||
dVel |
LREAL |
0 |
This variable contains the current path velocity. |
|
vecActTangent |
SMC_VECTOR3D |
This structure contains the path tangent, a unit vector. |
||
iLastSwitch |
INT |
0 |
This output contains the number of the last switch passed. Note: If several switches have been passed within one cycle, only the last one will be mentioned. |
|
dwSwitches |
DWORD |
0 |
This DWORD describes the current switch status of all switches 1 32. Bit0 of the DWORD represents switch1, Bit31 represents switch32. In contrast to iLastSwitch, this bit-field will also hold multiple switches in one cycle. |
|
dWayPos |
LREAL |
See input dLastWAyPos. |
||
wM |
WORD |
If the interpolator passes an M-function, this output will be set to the value associated to the M-function. The interpolator will stop until the M-function is acknowledged by input bAcknM. |
||
adToolLength |
ARRAY [0..2] OF LREAL |
Parameters for tool length compensation (set by G43 I/J/K) |