MC_TorqueControl

MC_TorqueControl 1:

The MC_TorqueControl function block 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 to the drive controller (Axis->Drive->Outputs->nDataOut5/nDataOut6) in the cyclic interface.

To change the operation mode without jerking, the dead time compensation must be activated in the NC axis.

DANGER

Danger to life or risk of serious injury or damage to property due to unintentional movements of the axis

When using the function block, the axis is switched to CST mode. After using the function block (especially after error situations), the axis may still be in CST mode. This can lead to sudden and unplanned movements (especially with lifting axes) when the axis is released.

  • Ensure that there is no hazard as defined by the risk assessment.
  • Check the current operation mode via the function block MC_ReadDriveOperationMode.
  • If the axis is not in a position-related operation mode (CSV/CSP), transfer it before an enable:
    directly with MC_WriteDriveOperationMode into the desired position-related operation mode (CSV/CSP) or
    indirectly with MC_Halt / MC_Stop into the desired position-related operation mode (CSV/CSP) (from TwinCAT 3.1.4024.40)
    Other function blocks that switch the axis indirectly into a position-related operation mode can only do this to a limited extent and are therefore not to be used for a deliberate operation mode change.
  • Subsequently, it is necessary to check again whether the axis is really in a position-related operation mode (CSV/CSP), if not, an abort with error handling is required.

In order for this module to be used sensibly, the drive controller must support switching of the operating modes on the fly, as well as speed limitation in torque mode.

The relevant parameters are available for scaling the actual and setpoint torque in the Drive area in the NC axis parameters.

Notes on parameterization for NC-guided position- and torque-based mixed operation are in preparation and will be published soon.

MC_TorqueControl 2: Inputs

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

Name

Type

Description

Execute

BOOL

The command is executed with a rising edge.

ContinuousUpdate

BOOL

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.

Relative

BOOL

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

Torque

LREAL

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

Here, a positive torque setting means torque in a logically positive direction of movement.

TorqueRamp

LREAL

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

VelocityLimitHigh

LREAL

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

VelocityLimitLow

LREAL

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

BufferMode

MC_BufferMode

Currently only "Aborting" is supported.

Options

ST_TorqueControlOptions

Data structure containing additional, rarely used parameters. The input can normally remain open.

See also: General rules for MC function blocks

MC_TorqueControl 3: Inputs/outputs

VAR_IN_OUT
    Axis : AXIS_REF;
END_VAR

Name

Type

Description

Axis

AXIS_REF

Axis data structure that unambiguously addresses an axis in the system. Among other parameters it contains the current axis status, including position, velocity or error state.

MC_TorqueControl 4: Outputs

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

Name

Type

Description

InTorque

BOOL

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

Busy

BOOL

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

BOOL

Indicates that the function block controls the axis.

CommandAborted

BOOL

TRUE if the command could not be executed completely.

Error

BOOL

TRUE, if an error occurs.

ErrorID

UDINT

If the error output is set, this parameter supplies the error number.

See also: General rules for MC function blocks

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024

PC or CX (x86)

Tc2_MC2