MC_TorqueControl 1:

MC_TorqueControl switches an axis under NC control to the "Cyclic Synchronous Torque Mode" (CST) and sets a torque setpoint for it. In this operation mode, the NC also provides the parameterized "VelocityLimitHigh" & "VelocityLimitLow" as linkable objects in the cyclic interface to the drive controller (Axis->Drive->Outputs->nDataOut5/nDataOut6).

When position-related motion blocks (e.g. MC_MoveVelocity or MC_MoveAbsolute) are called up, the operation mode is automatically switched back to the default operation mode.

For a jerk-free changeover of the operation mode, the dead time compensation must be activated in the NC axis.

In order for this function block to be used meaningfully, the drive controller must meet certain requirements.

Notes on parameterization for NC-controlled position- and torque-based mixed operation are in progress/coming soon.


    Execute            : BOOL; 
    ContinuousUpdate   : BOOL; 
    Relative           : BOOL; 
    Torque             : LREAL; 
    TorqueRamp         : LREAL;
    VelocityLimitHigh  : LREAL;
    VelocityLimitLow   : LREAL;
    BufferMode         : MC_BufferMode;
    Options            : ST_TorqueControlOptions; 

Execute: The command is executed with the rising edge.

ContinuousUpdate: If this input is TRUE on the rising edge at the "Execute" input, the "Torque", "TorqueRamp", "VelocityLimitHigh" and "VelocityLimitLow" inputs can be changed during the execution of the command and made effective as quickly as possible.

It should be noted that only the "Torque" value is transmitted cyclically.

Relative: If this input is TRUE, the torque value is changed relatively by the specified value "Torque".

Torque: Torque setpoint with which the drive is operated ("Relative" = FALSE) or by which the torque is to be changed ("Relative" = TRUE). (e.g. %)

TorqueRamp: Rate of change of the torque setpoint ( e.g. %/s)

VelocityLimitHigh: Upper velocity limit for limitation in CST mode (e.g. mm/s). This limitation must be configured accordingly in the process image.

VelocityLimitLow: Lower velocity limit for limitation in CST mode (e.g. mm/s). This limitation must be configured accordingly in the process image.

BufferMode: Only "Aborting" is supported.

Options: Data structure (ST_TorqueControlOptions), which contains additional, rarely required parameters. The input can normally remain open.

See also: General rules for MC function blocks


    InTorque           : BOOL;
    Busy               : BOOL;
    Active             : BOOL;
    CommandAborted     : BOOL;
    Error              : BOOL;
    ErrorID            : UDINT;

InTorque: TRUE, if the axis has built up the set torque and no velocity limitation is active.

Busy: TRUE as soon as the command is started with Execute and as long as the command is processed. If "Busy" is FALSE, the function block is ready for a new order.

Active: Indicates that the function block controls the axis.

CommandAborted: TRUE if the command could not be fully executed.

Error: TRUE if an internal error occurs.

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

See also: General rules for MC function blocks

MC_TorqueControl 2: Inputs/outputs

    Axis : AXIS_REF;






Axis data structure of the type AXIS_REF, which uniquely addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.


Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024

PC or CX (x86)