Torque Control using MC_TorqueControl
MC_TorqueControl is used to give torque control commands to the selected axis. The velocity input to the axis is not used and the axis will move at a high speed when executing torque control.
-
Torque Actual Value and Torque Demand Value must be added to the TxPDO for this function block to work. See Modifying TxPDO and RxPDO for Torque Values below.
-
Target Torque must be added to the RxPDO for this function block to work. See Modifying TxPDO and RxPDO for Torque Values below.
-
Axis will be in ContinuousMotion state while the function block is running.
-
LS_Connect and MC_Power must be executed before this function block can be used.
-
The examples in this topic can be found in the XMC_SingleAxis_FBs.zip downloadable from Example Applications.

Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input/Output | Axis reference variable. This can not be a constant. |
ContinuousUpdate | Input | Specify the update setting of the input value. This is explained in section 6.1.5 of the XMC user manual. |
Torque | Input | Specify the target torque. 100.0 equals 100% torque. |
TorqueRamp | Input | Specify the slope of the torque. |
Velocity | Input | Not used in MC_TorqueControl. |
Acceleration | Input | Not used in MC_TorqueControl. |
Deceleration | Input | Not used in MC_TorqueControl. |
Jerk | Input | Not used in MC_TorqueControl. |
Direction | Input | Specify the direction.1 – Forward Direction; 2 – Reverse Direction |
BufferMode | Input | Specify the sequential operation setting. See Buffer Mode table below. |
InTorque | Output | Indicates the inputted torque value and current operating torque value are equal. |
Busy | Output | Indicates the function block is currently being executed. |
Active | Output | Indicates the function block is controlling the axis. |
CommandAborted | Output | Indicates the function block was aborted. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number |
BufferMode Table
Sections 6.1.4 and 8.2.10 of the XMC user manual provide more information about buffer modes.
Value | Buffer Mode | Description |
---|---|---|
0 | Aborting | Abort previous command and execute the command immediately. |
1 | Buffered | Execute the command after previous command is completed. |
2 | BlendingLow | The new command is blended into a previously executed command using the lower velocity value when comparing the previous command and new command. |
3 | BlendingPrevious | The new command is blended into a previous command using the velocity of the previous command. |
4 | BlendingNext | The new command is blended into a previous command using the velocity from the new command. |
5 | BlendingHigh | The new command is blended into a previous command using the higher velocity value when comparing the previous command and new command. |

Step | Action |
---|---|
1 |
Double-click on the slave to add torque values to. This example shows Slave 1 – iX7NH servo drive.
|
2 |
Select PDO Setting in the 1.Slave window that opens up.
|
3 |
Choose PDO Type filter TxPDO.
|
4 |
In the PDOs to Map section, find Torque Demand Value and Torque Actual Value. Highlight them and press the down arrow to add them to the Mapped Objects. They must be done one at a time.
After adding to Mapped Objects:
|
5 |
Choose PDO Type filter RxPDO.
|
6 |
In the PDOs to Map section, find Target Torque. Highlight them and press the down arrow to add them to the Mapped Objects. They must be done one at a time.
After adding to Mapped Objects:
|

Before executing MC_TorqueControl
After executing MC_TorqueControl

//Set axis reference
Axis1 := 1;
IF (_AX01_RDY) AND (_AX01_SV_ON) THEN
//Example MC_TorqueControl fb
INST_TORQUECONTROL(Execute:=Execute_TrqControl, Axis:=Axis1,
ContinuousUpdate:=0, Torque:=INST_TORQUECONTROL.Torque,
TorqueRamp:=INST_TORQUECONTROL.TorqueRamp,
Velocity:=INST_TORQUECONTROL.Velocity,
Acceleration:=INST_TORQUECONTROL.Acceleration,
Deceleration:=INST_TORQUECONTROL.Deceleration,
Jerk:=INST_TORQUECONTROL.Jerk, Direction:=INST_TORQUECONTROL.Direction,
BufferMode:=0, ErrorID=>INST_TORQUECONTROL.ErrorID);
END_IF;
LM515