How to Limit the Movement

It is possible to limit the movement by position (software limit switches) and by velocity. By default, no software limit switches are activated in PS552. It is possible to activate them by accessing some PLCopen parameter.

The functionality described below is just available with linear axes.

  Parameter Data type Minimum Maximum Default R/W Description
2 SWLimitPos DINT 2147483647 2147483647 2147483647 R/W Positive Software limit switch position.
3 SWLimitNeg DINT 2147483647 2147483647 2147483647 R/W Negative Software limit switch position.
4 EnableLimitPos BOOL FALSE TRUE FALSE R/W Enable positive software limit switch.
5 EnableLimitNeg BOOL FALSE TRUE FALSE R/W Enable negative software limit switch.
2003 EnableLimit2Decelerate BOOL FALSE TRUE FALSE R/W -
2004 EnableLimitAbort BOOL FALSE TRUE FALSE R/W -
2005 EnableLimtVelocity BOOL FALSE TRUE FALSE R/W If the velocity is limited the unmoved position will be covered whenever possible
2006 SWLimit2DecPos LREAL -2147483647 2147483647 2147483647 R/W Used as end position for EnableLimit2Decelerate
2007 SWLimit2DecNeg LREAL -2147483647 2147483647 2147483647 R/W Used as end position for EnableLimit2Decelerate
2008 MaxPositionGap LREAL 0 214748364700 0 R/W Used to stop the ongoing movement if position is behind

The following different behavior is possible:

  • No limitation at all (default)
  • Limit position with ERRORSTOP:
    • Limit position between SWLimitNeg to SWLimitPos, axis to state ERRORSTOP in case the position range is left.
  • Limit velocity and acceleration:
    • Limit velocity to paraMaxVelocityAppl and acceleration/deceleration to paraMaxDecelerationAppl, create WARNING_VELOCITY, not state changes for axis, abort movement is optional when MaxPositionGap is reached due to limitation.
  • Limit Position with ramp-down:
    • In addition, it is possible to limit the position between SWLimit2DecNeg and SWLimit2DecPos. paraMaxDecelerationAppl is used to ramp down.

When activated with EnableLimitPos or EnableLimitNeg, the reaction will be as follows:

  • When the control position reaches the respective limit switch, the axis will go to state ERRORSTOP, and DRIVE_RELEASE will be switched off. The actual_position might be behind, depending on the following error. It is assumed that a drive or application specific braking is performed. The axis will be stopped behind the limit.
  • The axis could be switched on again by MC_POWER. A movement in the opposite direction will be possible.
  • The functionality of EnableLimitPos and EnableLimitNegis unchanged.

You can use the limitation of movement to achieve a soft or adjustable braking in advance before reaching the software limit switch. The limitation is activated by three boolean parameter and will calculate a position distance to the limit switch, which depends on the actual velocity and given deceleration ramp. “paraMaxDecelerationAppl” is used for deceleration. It will decelerate the axis by the given deceleration ramp when the calculated position is reached and stop at the software limit switch. The original behavior is not modified, so if also these softwarelimit-switches are activated, the axis might be set to state ERRORSTOP.

../_images/c258e16ee9c1dce00a317d3146ded636

There are 2 different modes:

  • EnableLimitAbort = TRUE

    Any ongoing motion will be aborted immediately (when the distance to stop is reached, as shown in the above diagram), a warning is shown

    The axis will be decelerated to reach the software limit switch.

  • EnableLimitAbort =FALSE, EnableLimitDecelerate=TRUE

    A warning is shown and the velocity is reduced, with respect to the given deceleration and position limit.

    The ongoing motion is not aborted. If it was just a “tight fit”, e.g. in a master slave movement and the direction is turned soon enough, it might be possible to continue the movement.

    As the ongoing movement is not interrupted, an activated movement might not be completed, for example a MC_MoveAbsolute will never reach its target position. A warning is shown at function block CMC_MOTION_KERNEL_REAL.

When EnableLimitPos = TRUE or EnableLimitNeg = TRUE, and the values for SWLimitPos or SWLimitNeg are set, the axis will be set to state ERRORSTOP when these position limits are reached.

In addition, the function block will allow to limit the velocity. With EnableLimitVelocity = TRUE, it will monitor the velocity demand from the position reference and limit the position reference, so the given velocity limit will not be exceeded. A warning will be shown. The velocity used for limitation is MaxVelocityAppl.

Note

The velocity limitation can be used to prevent short-term velocity peeks. The limited position will be catched up later, whenever possible. This can result in not-expected behavior. The WARNING issued by CMC_MOTION_KERNEL_REAL can be checked and used to stop a movement. The movement will be aborted automatically when the position is by MaxPositionGap behind.

  • For a single axis movement, the commanded velocity is limited at the beginning. No position gap will occur.
  • In a multi-axis movement, the slave axis follows a master. This can result in a position gap. A velocity peek from the master axis can be reduced by using the limitation. If the master is too fast because of the value for MaxPositionGap, the movement will be aborted.

When EnableLimit2Decelerate or EnableLimitAbort are used, the velocity is limited to MaxVelocitySystem with EnableLimitVelocity = FALSE. The function modifies the position reference. This modified position reference is used to control the drive. Whenever the limitation interferes the kernel will show a warning or an error. The warning or error message will disappear when the situation is cleared.

4 EnableLimitPos TRUE ERRORSTOP when positions exceed, no previous warning or deceleration.
5 EnableLimitNeg TRUE
2003 EnableLimit2Decelerate FALSE
2004 EnableLimitAbort FALSE
2005 EnableLimtVelocity FALSE
4 EnableLimitPos FALSE/TRUE Reduce the velocity when reaching a position limit within the deceleration distance calculated by using MaxDecelerationAppl. Display a warning at CMC_MOTION_KERNEL_REAL. The underlying movement stays active. With EnableLimitPos = TRUE or EnableLimitNeg = TRUE: When the Position limit is reached, the axis is set to mode ERRORSTOP also if EnableLimitPos or EnableLimitNeg are used. Otherwise, just the movement is limited, without affecting the statemachine. An activated positioning movement will not reach its target. Velocity is limited to MaxVelocitySystem.
5 EnableLimitNeg FALSE/TRUE
2003 EnableLimit2Decelerate TRUE
2004 EnableLimitAbort FALSE
2005 EnableLimtVelocity FALSE
4 EnableLimitPos FALSE/TRUE

Reduce the velocity when reaching a position limit within the deceleration distance calculated by using MaxDecelerationAppl. Display a warning at CMC_MOTION_KERNEL_REAL. The underlying movement stays active. With EnableLimitPos = TRUE or EnableLimitNeg = TRUE: When the Position limit is reached, the axis is set to mode ERRORSTOP also if EnableLimitPos or EnableLimitNeg are used. Otherwise, just the movement is limited, without affecting the statemachine. An activated positioning movement will not reach its target. Velocity is limited to MaxVelocitySystem.

The active PLCopen function block is aborted as soon as the warning is issued. With EnableLimitPos = TRUE or EnableLimitNeg = TRUE: When the Position limit is reached, the axis is set to mode ERRORSTOP.

5 EnableLimitNeg FALSE/TRUE
2003 EnableLimit2Decelerate
2004 EnableLimitAbort TRUE
2005 EnableLimtVelocity FALSE
4 EnableLimitPos The velocity is checked and also limited to the value MaxVelocityAppl. A warning is shown. The active movement is not aborted. This functionality works independent from software limit switches.
5 EnableLimitNeg
2003 EnableLimitDecelerate
2004 EnableLimitAbort
2005 EnableLimtVelocity TRUE