SMC_ExtendedVelocityChecks (FB)

 

FUNCTION_BLOCK SMC_ExtendedVelocityChecks

This function reduces the velocity, acceleration and deceleration of the path so that the resulting velocity, acceleration and deceleration values for the additional axes (Z, P, Q, U, V, W and additionally Z for the 2D mode) do not exceed the values set in F<Axis> and E<Axis> .

These limits are typically defined in the G-code by using the G-code words FZ, FP, FQ, FU, FV, FW and EZ, EP, EQ, EU, EV, EW.

FF0, FZ0, FP0, ..., FW0 reset the velocity limit of the associated axis. EF0, EZ0, EP0, ..., EW0 reset the limitation of acceleration or decelera­tion of the associated axis. FZ and EZ are only valid in the 2D-mode.

Additionally there are EA, EB, EC and FA, FB and FC associated to A, B and C which overlay the axis U, V and W.

Example

Acceleration and deceleration values are set for additional axis for limit them. In sentence N0, the acceleration of additional axis P is limited to 10, the deceleration is limited to 13. In sentence N1, the limitations on additional axis P are reset again (EP0).

G-Code:

N0 G1 X100 EP10 EP-13 P100
N1 G1 X200 EP0 P0

E<axis>/F<axis>

The following code is used to define velocity/acceleration/deceleration of a additional axes <axis> by E<axis>/F<axis>.

G-Code

N20 M9
N030 F10 E40.0 E-40.0
N040 M8
N050 G92 X0.0 Y0.0 Z570.0 U35.0 V225.0 W20.0 P382.0 (Starting position)
N060 G1 X0.0 Y0.0 Z570.0 U35.0 V225.0 W20.0 P382.0
N230 G0 X0.0 F200.0 E200.0 E-200.0
N240 M7
N250 F50.0 E40.0 E-40.0
N260 G0 U100.0 V158.0 W100.0 P260.0 Y100.0 Z400.0 F50.0
N270 G0 V125.0 P260.0 Z400.0 FV1.25 EV500 EV-500 (additional axis V is set)
N280 G0 V170.0 P260.0 Z400.0 FV50.0
N285 G0 V170.0 P260.0 Z400.0 FP100.0 EP500 EP-500 (additional axis P is set)
N290 G0 X0.0 F200.0 E200.0 E-200.0
N300 M7
N310 F50.0 E40.0 E-40.0
N320 G0 U100.0 V158.0 W100.0 P260.0 Y100.0 Z400.0 F50.0
N330 G0 V125.0 P260.0 Z400.0 F1.25
N340 G0 V170.0 P260.0 Z400.0 F50.0
N350 M8

InOut:

Scope

Name

Type

Initial

Comment

Input

bExecute

BOOL

FALSE

Execution starts on the rising edge.

bAbort

BOOL

FALSE

If FALSE at a rising edge of bExecute, the output queue poqDataOut is emptied

bAppend

BOOL

FALSE

If FALSE at a rising edge of bExecute, the output queue poqDataOut is emptied

poqDataIn

POINTER TO SMC_OUTQUEUE

NULL

This input points to the SMC_OUTQUEUE structure object, which describes the SMC_GEOINFO objects of the path; typically it points to the output poqDataOut of the preceding module (e.g. SMC_NCDecoder / SMC_SmoothPath ).

nSizeOutQueue

UDINT

0

This variable contains the size of the data buffer, the list of SMC_GEOINFO structure objects will be written to. This buffer must be able to hold at least five SMC_GEOINFO objects. Otherwise, the function block will not execute any actions at all. Its size may be predefined, but may be modified later only during a reset. It is recommended to create the buffer as described by the example below:

ExampleBuf: ARRAY[1..50] OF SMC_GEOINFO

The appropriate buffer size will then be retrieved by use of the operator sizeof(ExampleBuf).

pbyBufferOutQueue

POINTER TO ARRAY [0..0] OF SMC_GEOINFO

NULL

This input must point to the first byte of the memory area that is allocated for the SMC_OUTQUEUE structure. This area must be at least as big as defined in nSizeOutQueue. Typically the allocation of the memory buffer is done in the declaration part of the IEC-program by defining an array of SMC_GEOINFO e.g. BUF: ARRAY[1..50] OF SMC_GEOINFO; for a buffer that can store 50 path elements). The value may be predefined, but may be modified later on only during 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

bBusy

BOOL

FALSE

TRUE, while execution of function block is not finished and the process on the path object is still running

bError

BOOL

FALSE

Signals that an error has occurred within the function block

wErrorID

SMC_ERROR

SMC_NO_ERROR

Error identification

poqDataOut

POINTER TO SMC_OUTQUEUE

NULL

This variable points to a SMC_OUTQUEUE structure, which manages the SMC_GEOINFO objects of the loopless path.