MC_Stop

MC_Stop 1:

An axis is stopped with the function block MC_Stop.

VAR_INPUT

VAR_INPUT
    Execute      : BOOL;
    Deceleration : LREAL;
    Jerk         : LREAL;
END_VAR

Execute : The command is executed with rising edge.

Deceleration : Deceleration during brake travel.

If the value is 0, the deceleration from the move command is used. A non zero value will only be accepted if a Jerk value is passed as well.

Jerk : Jerk during brake travel.

If the value is 0, the jerk from the move command is used. A non zero value will only be accepted if a Deceleration value is passed as well.

Note:

The start command is used to specify the dynamic parameters (deceleration and jerk) for an axis. If no parameters are specified, the default values from the dynamics menu of the axis (TwinCAT System Manager) are used. For software versions up to TwinCAT version 2.10 Build 1242, MC_Stop can only be used to increase the deceleration dynamics, i.e. both deceleration and jerk must be equal or greater than the current dynamic values.

From TwinCAT 2.10 Build 1243 a new set value generator (7 phases optimized) was introduced that can be selected in the global axis parameters. This means that weaker deceleration dynamics can be specified with an MC_Stop command, in order to decelerate more slowly than originally specified. For safety reasons the following exceptions apply, in which case the weaker parameters are not used:

  • If the target position would be exceeded
  • If a stop with more rigorous dynamics had already been initiated
  • If the axis is in a acceleration phase, and the velocity would exceed the parameterised travel speed due to weaker dynamic parameters (acceleration would reduce too slowly)
  • If the axis is in a braking phase, and the direction of travel would reverse due to weaker dynamic parameters (negative acceleration cannot be reduced in time)

In all cases the axis is stopped safely and without error, even if weaker dynamic parameters are not accepted for the cases described above, i.e. if the current, more rigorous parameters are retained.

VAR_OUTPUT

VAR_OUTPUT
    Done    : BOOL;
    Error   : BOOL;
    ErrorID : UDINT;
END_VAR

Done : Becomes TRUE, once axis has finished its job and stands still.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID : Supplies the error number when the Error output is set.

VAR_IN_OUT

VAR_IN_OUT
    Axis : NCTOPLC_AXLESTRUCT;
END_VAR

Axis : Axis structure.

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v2.8

PC (i386)

TcMC.Lib