SMC_LimitDynamics (FB)

 

FUNCTION_BLOCK SMC_LimitDynamics

The function block reduces the velocity and acceleration/deceleration of the path so that the resulting velocities, accelerations and decelerations of the cartesian and additional axes do not exceed the input values dMaxVel, dMaxAcc and dMaxDec.

Note

SMC_LimitDynamics was renamed and was previously named SMC_LimitAddAxisDynamics.

Using SMC_LimitDynamics

Assignment of input poqDataIn

Typically, poqDataOut of the previous function block is fed to the input poqDataIn. That can be an instance of the function block SMC_NCDe­coder or SMC_SmoothPath.

Allocating memory for the preprocessing of the path elements

If the function block is executed, memory is needed, in which the processing elements are copied. The memory area must be able to hold at least five SMC_GEOINFO objects. If the memory is too small, the function block performs no actions. The memory is declared in the IEC program as an array of objects of type SMC_GEOINFO.

PROGRAM Path
VAR
   buf2: ARRAY[1..50] OF SMC_GeoInfo;
END_VAR

Feeding the allocated memory area

The size of the memory is determined by the operator SIZEOF in the implementation of the IEC program and is fed to the input nSizeOut­Queue. The address of the memory is defined with the operator ADR and is fed to the input pbyBufferOutQueue.

SMC_CheckForLimits.png

InOut:

Scope

Name

Type

Initial

Comment

Input

bExecute

BOOL

FALSE

Execution starts on the rising edge.

bAbort

BOOL

FALSE

TRUE: Aborts the processing of the function block

bAppend

BOOL

FALSE

FALSE: Starts emptying poqDataOut on a rising edge at bExecute

poqDataIn

POINTER TO SMC_OUTQUEUE

NULL

Pointer to data of structure SMC_OUTQUEUE containing the path objects of typ SMC_GEOINFO.

wAxis

WORD

Bit field of the axes on that the operation is executed:

  • X: Bit 0

  • Y: Bit 1

  • Z: Bit 2

  • A: Bit 3

  • B: Bit 4

  • C: Bit 5

  • P: Bit 6

  • Q: Bit 7

  • U: Bit 8

  • V: Bit 9

  • W: Bit 10

Example: 16#0104 causes limitation of Z and U

dMaxVel

LREAL

0

Maximum speed value for the defined axes

dMaxAccDec

LREAL

0

Maximum acceleration or deceleration value ​​for the defined axes

bIncludePathSettings

BOOL

FALSE

TRUE: Limits the velocity, acceleration or deceleration (F, E +, E-) on the values ​​defined in dMaxVel and dMaxAccDec

nSizeOutQueue

UDINT

0

Size in bytes of the data buffer pbyBufferOutQueue, in which the path elements are copied. If the value is set, it may not be changed except after a reset.

pbyBufferOutQueue

POINTER TO ARRAY [0..0] OF SMC_GEOINFO

NULL

Pointer to the first byte of the storage area created for the path elements. If the value is set, it may not be changed except after a reset.

bStrictlyHoldAccDecABC

BOOL

FALSE

If TRUE, the maximal accelerations and decelerations of A, B, C are strictly held. Otherwise, we use a heuristic that may lead to quicker profiles, but occasionally violate the A/B/C-acceleration-limit, if A/B/C move quickly while there is an ac- / deceleration on the path.

Output

bDone

BOOL

FALSE

TRUE: input date from poqDataIn have been precessed fully. After that, the function block performs no action until a reset is detected. When bExecute is set to FALSE, bDone is reset to FALSE.

bBusy

BOOL

FALSE

TRUE: Function block in execution

bError

BOOL

FALSE

TRUE: Error has occurred

wErrorID

SMC_ERROR

SMC_NO_ERROR

Error identification

poqDataOut

POINTER TO SMC_OUTQUEUE

NULL

Pointer to data of structure SMC_OUTQUEUE containing the path elements of typ SMC_GEOINFO.