SMC_Interpolator (FB)¶
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- 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 - poqDataOutof SMC_CheckVelocities .- bSlow_Stop- BOOL- If this variable is set to - FALSE, the path will be passed non-stop. Otherwise, the- SMC_Interpolatorwill 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_Stopwill be reset to- FALSE.- bEmergency_Stop- BOOL- As soon as this input gets - TRUE, the- SMC_Interpolatorwill cause an immediate stop, this means that the position will be retained. Hence, the velocity will be set to 0 immediately.- bWaitAtNextStop- BOOL- As long as this variable is - FALSE(default), the path is passed non-stop. Otherwise, the- SMC_Interpolatorwill 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- bWaitAtNextStopwill be reset to- FALSE.- dOverride- LREAL- 1 - This variable can be used to handle the override. The value of - dOverrideis 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=2would 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- This variable has to be set for each call. It represents the cycle time in μsec. - dLastWayPos- LREAL- This input allows the user to measure the stretch of the path that is racked out by the interpolator. Output - dWayPosis the sum of- dLastWayPosand the distance covered within the current cycle. If- dLastWayPosis set equal to output- dWayPos,- dWayPoswill always be incremented by the current path segment and the result will be the total length of the path travelled.- dLastWayPoscan be (re)set to 0 or to a different value at any time.- bAbort- BOOL- This input set to - TRUEwill abort the function block and reset the outputs. A rising edge of- bExecuteis required to start the interpolator again after aborting.- bSingleStep- BOOL- 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 - bSingleStepis set to- TRUEduring 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), - bWaitAtNextStopmust be used.- bAcknM- BOOL- This input can be used to acknowledge an M-function. If the input is - TRUE, the output- wMwill be cleared and the path processing will be continued.- bQuick_Stop- BOOL- If this input is - TRUE, the interpolator will reduce the velocity to zero, until- bQuick_Stopis reset to- FALSE. The reduction is done according to the defined velocity profile (- byVelMode) and the deceleration given by the maximum of- dQuickDecelerationand 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- This variable will be set to - TRUEas 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- bExecuteis- FALSE,- bDonewill be reset to- FALSE.- bBusy- BOOL- TRUEwhile execution of function block is not finished- bError- BOOL- Signals that an error has occurred within the function block - wErrorID- SMC_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: - IPO_UNKNOWN(0): internal state that may not occur after a complete pass of the- SMC_Interpolator.
- IPO_INIT(1): initialization state; poqDataIn is not filled completely.
- IPO_ACCEL(2): accelerating
- IPO_CONSTANT(3): moving with constant velocity
- IPO_DECEL(4): decelerating
- IPO_FINISHED(5): path is finished. Any further SMC_GEOINFO objects arriving afterwards in- poqDataInwill not be processed.
- IPO_WAIT(6): waiting because one of the following situations has occurred:
- bEmergency_Stop = TRUE
- bSlow_Stop = TRUEand- dVel = 0
- bWait_At_Next_Stop = TRUEand- dVel = 0
 
 
- IPO_INCREASING_ACCEL(7): increasing acceleration
- IPO_DECREASING_ACCEL(8): decreasing acceleration
- IPO_INCREASING_DECEL(9): increasing deceleration
- IPO_DECREASING_DECEL(10): decreasing deceleration
 - bWorking- BOOL- This output is intended to be connected to input - bEnableof SMC_ControlAxisByPos .- It will be - TRUEif (and only if) the processing of the list has been started and not yet finished- iActObjectSourceNo- DINT- -1 - Value of member - iSourceLine_Noof 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- This variable contains the current path velocity. - vecActTangent- SMC_VECTOR3D- This structure contains the path tangent, a unit vector. - iLastSwitch- INT- 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- This - DWORDdescribes the current switch status of all switches 1 32. Bit0 of the- DWORDrepresents 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) - Act_Object- POINTER TO SMC_GEOINFO - Pointer to the currently interpolated path element. Possibly 0. 
Structure:
