MC_StepLimitSwitch
This function Block performs a homing function and sets the position by searching for a limit switch. Logic is built-in to account for cases in which the limit is already hit.
Parameters
| * | Parameter | Data Type | Description | Default |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| B | Axis | AXIS_REF | Logical axis reference. This value can be located on the Configuration tab in the Hardware Configuration (logical axis number). | |
| VAR_INPUT | ||||
| B | Execute | BOOL | Upon the rising edge, all other function block inputs are read and the function is initiated. To modify an input, change the value and re-trigger the execute input. | FALSE |
| E | Direction | MC_Direction | Specifies the direction of the motion and corresponding limit switch to search for : • PositiveDirection = Positive direction searching for the positive limit switch (P-OT signal) • NegativeDirection = Negative direction searching for the negative limit switch (N-OT signal) ‘Direction’ is automatically reversed from limit switch initial state. |
MC_Direction#PositiveDirection |
| E | LimitSwitchMode | MC_SwitchMode | Sensor condition to finalize
MC_StepLimitSwitch. Only
MC_SwitchMode#EdgeOn is supported.
|
MC_SwitchMode#EdgeOn |
| E | Velocity | LREAL | Absolute value of the velocity in user units/second. | LREAL#0.0 |
|
E
|
SetPosition |
LREAL |
After performing the limit switch search, this is the position to set the Axis to. A positive or negative value within the coordinate system in user units.
|
Not Used |
|
E
|
SetPositionMode
|
BOOL |
ABSOLUTE = False (Default), RELATIVE =True. This refers to the coordinate system, not the motor type.
|
FALSE |
| E | TorqueLimit | LREAL | Maximum torque or force [in % of rated torque].The amplifier's Torque Limits (Pn402 and Pn403) will override the torque limit set by this value if they are lower than the TorqueLimit setting. | LREAL#100.0 (100% of rated torque) |
| E | TimeLimit | LREAL | Time limit for homing to complete (in seconds). Value of LREAL#0.0 sets no time limit. | LREAL#0.0 |
| E | DistanceLimit | LREAL | Maximum distance the axis can travel in search of home sensor. Value of LREAL#0.0 sets no distance limit. | LREAL#0.0 |
| E | BufferMode | MC_BufferMode | Defines the behavior of the axis - allowable modes are Aborting, Buffered, BlendingLow, BlendingPrevious, BlendingNext, and BlendingHigh.
|
MC_BufferMode#Aborting |
| VAR_OUTPUT | ||||
| B | Done | BOOL | The Done output is set to TRUE when the commanded action has completed successfully. If another function block takes control before the action is completed, the Done output will never become TRUE. This output is reset when Execute becomes FALSE. | |
| E |
Busy |
BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) |
|
| E |
Active |
BOOL | For buffered modes, this output is set high at the moment the block takes control of the axis. For non buffered modes, the outputs Busy and Active have the same value. |
|
| E |
CommandAborted |
BOOL | Set high if motion is aborted by another motion command or
MC_Stop. This output is cleared with the same behavior as the Done output. |
|
| B |
Error |
BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. |
|
| E |
ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. |
|
Notes
- This function block references the SERVOPACK P-OT and N-OT functions. Refer to the SERVOPACK parameters Pn50A and Pn50B for P-OT and N-OT configurations.
- For proper operation, Pn001.1 'Overtravel Stopping Method' must be set to 1 to maintain servo on even while a limit switch is active. The function block cannot complete successfully if the servo is disabled during the process.
- TimeLimit, DistanceLimit, and TorqueLimit have a default value of 0.0, which means an infinite limit.
- This function block does not include Acceleration and Deceleration input parameters. During the homing operation, the SERVOPACK is operated in velocity mode. In this mode, the SERVOPACK uses Pn305 and Pn306 for Acceleration and Deceleration. The default is 0 [ms] to rated motor speed (infinite acceleration). Some users have reported the ErrorID=3 when the TorqueLimit input is set to zero or a very high value. This may be due to a relatively high value of Velocity, which may require high motor torque during acceleration and deceleration. If ErrorID=3 occurs in this condition, set Pn305 and Pn306 such that the acceleration is lower, or reduce the Velocity.
-
If no value is specified for the SetPosition input, then the Function Block will execute without changing the position.
Error Description
See the
Function Block ErrorID List
Example 1
MC_StepLimitSwitch executed on Axis1.
The Logic Analyzer trace for the above program is shown below: