MC_Home (Homing)
An axis reference run is carried out with the function block MC_Home.
Reference mode is set in the options with the parameter "ReferenceMode".
The parameters involved may have to be set in the drive parameters. For the servo terminal, the parameters can be found in the objects DMC Setting (0x8030) or DMC Features (0x8031). |
Inputs
VAR_INPUT
Execute : BOOL;
Position : LREAL := DEFAULT_HOME_POSITION;
HomingMode : MC_HomingMode;
Options : ST_HomingOptions;
END_VAR
Name | Type | Description |
---|---|---|
Execute | BOOL | The command is executed with a rising edge. |
Position | LREAL | Absolute reference position to which the axis is set after homing. Alternatively, the constant DEFAULT_HOME_POSITION can be used here. In this case, the "Reference position for homing" specified in the TwinCAT System Manager is used. |
HomingMode | MC_HomingMode | Determines how the calibration is performed. (Type: MC_HomingMode)
|
Options | ST_HomingOptions | Data structure containing additional parameters.
The signal of a referencing cam must be routed to a digital terminal input (HomingMode = MC_DefaultHoming). |
Since the reference position is generally set during the motion, the axis will not stop exactly at this position. The standstill position differs by the braking distance of the axis, although the calibration is nevertheless exact. |
Inputs/outputs
VAR_IN_OUT
Axis : AXIS_REF;
END_VAR
Name | Type | Description |
---|---|---|
Axis | 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. |
Outputs
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Active : BOOL;
CommandAborted : BOOL;
Error : BOOL;
ErrorID : UDINT;
END_VAR
Name | Type | Description |
---|---|---|
Done | BOOL | TRUE when the axis has been calibrated and the movement is complete. |
Busy | BOOL | TRUE as soon as the command is started with "Execute" and as long as the movement command is processed. If "Busy" is FALSE, the function block is ready for a new order. At the same time, one of the outputs "Done", "CommandAborted" or "Error" is set. |
Active | BOOL | Currently not implemented - "Active" indicates that the command is running. If the command has been buffered, it may only become active after a running command has been terminated. |
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. |
Note
The referencing process has several phases. The following diagram illustrates the sequence after starting function block MC_Home with the individual phases for the case HomingMode = MC_DefaultHoming.
Requirements
Development environment | PLC libraries to include |
---|---|
TwinCAT 3.1.4024.11 | Tc3_DriveMotionControl |