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
bExecuteBOOLExecution starts on the rising edge.
poqDataInPOINTER 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_StopBOOLIf this variable is set to
FALSE, the path will be passed non-stop. Otherwise, theSMC_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 untilbSlow_Stopwill be reset toFALSE.bEmergency_StopBOOLAs soon as this input gets
TRUE, theSMC_Interpolatorwill cause an immediate stop, this means that the position will be retained. Hence, the velocity will be set to 0 immediately.bWaitAtNextStopBOOLAs long as this variable is
FALSE(default), the path is passed non-stop. Otherwise, theSMC_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 untilbWaitAtNextStopwill be reset toFALSE.dOverrideLREAL1
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 bydOverride; thus the scheduled velocity can be increased resp. reduced in online mode. For exampledOverride=1(default) effects that the programmed scheduled velocities will be executed, whereasdOverride=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.
iVelModeTRAPEZOID
This input defines the velocity profile as defined in SMC_INT_VELMODE.
dwIpoTimeDWORDThis variable has to be set for each call. It represents the cycle time in μsec.
dLastWayPosLREALThis input allows the user to measure the stretch of the path that is racked out by the interpolator. Output
dWayPosis the sum ofdLastWayPosand the distance covered within the current cycle. IfdLastWayPosis set equal to outputdWayPos,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.bAbortBOOLThis input set to
TRUEwill abort the function block and reset the outputs. A rising edge ofbExecuteis required to start the interpolator again after aborting.bSingleStepBOOLThis 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 toTRUEduring 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.bAcknMBOOLThis input can be used to acknowledge an M-function. If the input is
TRUE, the outputwMwill be cleared and the path processing will be continued.bQuick_StopBOOLIf this input is
TRUE, the interpolator will reduce the velocity to zero, untilbQuick_Stopis reset toFALSE. The reduction is done according to the defined velocity profile (byVelMode) and the deceleration given by the maximum ofdQuickDecelerationand the delay currently programmed in the path. If a quadratic velocity mode is used, then the jerk is limited bymax(dJerkMax, dQuickStopJerk).dQuickDecelerationLREALDeceleration value used for
bQuick_StopdJerkMaxLREALMagnitude 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.
dQuickStopJerkLREALThe magnitude of the jerk is used by a quick stop for ramping down the acceleration if one of the quadratic velocity modes is selected.
bSuppressSystemMFunctionsBOOLIf this option is set, then the output wM will not be set for internal M-functions created by G75 or G4 commands.
Output
bDoneBOOLThis 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 inputbExecuteisFALSE,bDonewill be reset toFALSE.bBusyBOOLTRUEwhile execution of function block is not finishedbErrorBOOLSignals that an error has occurred within the function block
wErrorIDSMC_ERRORError identification
piSetPositionIt 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
iStatusIPO_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 theSMC_Interpolator.IPO_INIT(1): initialization state; poqDataIn is not filled completely.IPO_ACCEL(2): acceleratingIPO_CONSTANT(3): moving with constant velocityIPO_DECEL(4): deceleratingIPO_FINISHED(5): path is finished. Any further SMC_GEOINFO objects arriving afterwards inpoqDataInwill not be processed.IPO_WAIT(6): waiting because one of the following situations has occurred:bEmergency_Stop = TRUEbSlow_Stop = TRUEanddVel = 0bWait_At_Next_Stop = TRUEanddVel = 0
IPO_INCREASING_ACCEL(7): increasing accelerationIPO_DECREASING_ACCEL(8): decreasing accelerationIPO_INCREASING_DECEL(9): increasing decelerationIPO_DECREASING_DECEL(10): decreasing deceleration
bWorkingBOOLThis 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 finishediActObjectSourceNoDINT-1
Value of member
iSourceLine_Noof active SMC_GEOINFO object ofpoqDataIn-queue. (bWorking = FALSE), the value is set to “-1”.dActObjectLengthLREALThe length of the current object; valid if
bWorking = TRUE.dActObjectLengthRemainingLREALThe remaning length of the current object; valid if
bWorking = TRUE.dVelLREALThis variable contains the current path velocity.
vecActTangentSMC_VECTOR3DThis structure contains the path tangent, a unit vector.
iLastSwitchINTThis 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.
dwSwitchesDWORDThis
DWORDdescribes the current switch status of all switches 1 32. Bit0 of theDWORDrepresents switch1, Bit31 represents switch32. In contrast toiLastSwitch, this bit-field will also hold multiple switches in one cycle.dWayPosLREALSee input
dLastWAyPos.wMWORDIf 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.adToolLengthARRAY [0..2] OF LREAL
Parameters for tool length compensation (set by G43 I/J/K)
Act_ObjectPOINTER TO SMC_GEOINFO
Pointer to the currently interpolated path element. Possibly 0.
Structure: