Stopping a SIMOTION Axis by Torque Limit: P1520 vs Command

David Krause17 min read
Motion ControlSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Two principal methods exist on a SIMOTION motion controller to clamp or arrest an axis by torque, and the choice between them determines whether the application achieves a clean controlled stop or simply drives the drive into a saturation condition. The two approaches are:

  1. Drive-parameter torque limit (SINAMICS parameter P1520) — directly clamp the torque in the SINAMICS S/G drive's closed-loop control block.
  2. SIMOTION MotionCommand torque limiting (_enableTorqueLimiting / _disableTorqueLimiting) — request torque limiting from the SIMOTION MotionControl framework, which writes P1520 for you and manages the axis state machine (anti-windup, status reporting, controlled exit).

A third, related primitive — Travel to fixed endstop (_enableMovingToEndStop) — is the proper MCC command for driving an axis into a mechanical hard stop with a defined clamping force. The reference document is the SIMOTION MotionControl Programming and Operating Manual on the Siemens Industry Online Support portal: SIMOTION MotionControl – Programming and Operating Manual. Drive-side reference for the parameter block is the SINAMICS S120/S150 List Manual at SINAMICS S120/S150 List Manual. The travel-to-endstop topic note is at SIMOTION FAQ: Travel to fixed endstop.

Prerequisites

  • SIMOTION controller (D4xx, D410, D425, D435, D445, D455, or CX32/CX32-2) running firmware V4.4 SPx or later (V5.x recommended for current builds). The technology objects (TO) must be configured for the axis.
  • SINAMICS S120 (or G120/G120D with CU3xx) drive on PROFINET or PROFIBUS-DP. The drive must have completed basic commissioning in STARTER or SIMOTION SCOUT/TIA Portal (with the SIMOTION Option).
  • Axis technology object of type TO_SynchronousAxis (servo) or TO_SpeedAxis. The homing state and the position-control loop must be active.
  • For MCC: the corresponding MotionCommand library in the project. For ST/LAD/FBD: the function blocks from the MotionControl library.
  • Drive trace configured to read r0080 (actual torque) and r1525/r1526 (currently applied torque limits) for diagnostics.

Background: Drive-Level Torque Limit P1520

What P1520 Does

P1520 is a SINAMICS parameter on the closed-loop control block. It defines a torque limit (in units of the resolved torque, typically N·m) applied after the speed controller and before the current setpoint. The exact behavior depends on the parameter version:

  • P1520 = fixed number (e.g. 90.0): limits torque to that absolute value. Sign convention follows the drive: positive limits the upper side; pair with P1521 for the lower side.
  • P1520 = connector source (e.g. r2050[1] or 3001[1]): the drive interprets the value at the connector as a normalized torque limit (typically 0–100 % of rated torque, derived from the active data set). P1522 / P1523 apply as scaling factors.
  • P1520 = 0 (default): no additional clamp; the drive uses the calculated upper torque limit r1525 (which itself derives from the motor data set, the p0641 current limit, and the drive's protection limits).

Surrounding Parameter Group

Parameter Meaning Default Typical range
P1520[0..n] Torque limit upper / CO source 0 0 – 2× rated torque
P1521[0..n] Torque limit lower / CO source 0 0 – 2× rated torque
P1522[0..n] Torque limit upper scaling 100 % 0 – 65535 %
P1523[0..n] Torque limit lower scaling 100 % 0 – 65535 %
P1524[0..n] Torque limit scaling source 1 –400 – 400 %
r1525 Torque limit upper (active) — Nm read-back
r1526 Torque limit lower (active) — Nm read-back
r0080 Actual torque — Nm
r0081 Torque utilization (M/M_max) — %

Why P1520 Alone Is Not a Stop

SIMOTION MotionCommand Torque Limiting

Command Interface

The MCC command and its ST equivalent put the axis into a managed torque-limited state. The function block signatures are:

_enableTorqueLimiting(
    axis                : Axis_Ref,
    torqueLimit         : LREAL,
    positionControlMode : enum_torque_limiting_pc_mode,  // ACTIVE or INACTIVE
    forceCutOff         : BOOL := FALSE);                 // optional, firmware >= V4.5

_disableTorqueLimiting(axis : Axis_Ref);

When dispatched, the following are observable on the technology object:

  • UserDefaultTorqueLimiting.TorqueLimit — the default value pre-loaded into the command; visible on the HMI/trace.
  • UserDefaultTorqueLimiting.PositionControlMode — the selector the operator can change before dispatch.
  • TorqueLimitingCommand.State — ACTIVE while the command is engaged, INACTIVE after _disableTorqueLimiting.
  • TorqueLimitingCommand.Error — command-side fault flag.
  • actualTorque — live torque from the drive (r0080), updated every IPO/IPO2 cycle.

State Machine

The axis does not transition to a separate "stopped" state when _enableTorqueLimiting is dispatched. The axis remains in its current operation mode (positioning, speed, synchronous), but the torque clamp is applied. The state diagram is:

  ┌───────────────────┐
  │ Positioning /     │
  │ Speed / Sync      │ <-- default axis state
  └─────────┬─────────┘
            │ _enableTorqueLimiting()
            │ (commandId dispatched)
            ▼
  ┌───────────────────┐
  │ Torque-Limited    │
  │ State = ACTIVE    │ <-- drive clamped at TorqueLimit
  └─────────┬─────────┘
            │ _disableTorqueLimiting()
            │ OR axis error / _reset
            ▼
  ┌───────────────────┐
  │ Restored          │
  │ Positioning / …   │ <-- normal operation resumes
  └───────────────────┘

Comparison: P1520 vs _enableTorqueLimiting

Aspect Direct P1520 write _enableTorqueLimiting
Writes drive parameter Yes, by user code Yes, by SIMOTION internally
Axis state-machine awareness None — SIMOTION sees a "saturated drive" Full — anti-windup, controlled reaction, status
Following-error fault on contact Yes, typically within a few hundred ms No, if POSITION_CONTROL_INACTIVE selected
Returns to normal automatically No, must clear P1520 manually No, must call _disableTorqueLimiting
UserDefaultTorqueLimiting.TorqueLimit used No Yes, HMI displays the active limit
actualTorque visible Yes (r0080) Yes (r0080)
TorqueLimitingCommand.State used No (always INACTIVE) Yes (becomes ACTIVE when limited)
Safety/collision application Not safe as a control loop Acceptable for non-safety collision reaction
Typical use Test-rig clamping, drive-side cap during commissioning Press-in, cap-on, robotic collision recovery

Direct Answer to the Common Question

"If I don't use _enableTorqueLimiting and just set P1520 = 90, when the actual torque goes above 90, will it stop?"

No. Setting P1520 = 90 clamps the drive torque to 90 N·m, but the axis will not "stop" — the motor keeps closing the position error at up to 90 N·m, the following error accumulates, and the axis eventually faults. P1520 is the drive-side clamp only. To get a controlled torque-limited motion you must use the SIMOTION command, because only that path updates the axis state machine and handles the anti-windup.

Travel to Fixed Endstop: _enableMovingToEndStop

When the application is to drive the axis into a known mechanical hard stop and hold it there with a defined clamping force (a press-fit, a clamp pin, a cap, a fixture), the proper primitive is:

_enableMovingToEndStop(
    axis            : Axis_Ref,
    position        : LREAL,         // end-stop position
    torque          : LREAL,         // clamping torque in N·m
    velocity        : LREAL := ...,  // approach velocity
    acceleration    : LREAL := ...,
    deceleration    : LREAL := ...,
    direction       : enum_dir := POSITIVE,
    forceCutOff     : BOOL := FALSE);

_disableMovingToEndStop(axis : Axis_Ref);

Key behavior:

  • The axis moves at the commanded velocity to the end-stop position and continues to drive against the stop with the configured clamping torque.
  • SIMOTION detects contact (a drop in actual speed / rise in torque above the configured limit) and clamps the torque.
  • MovingToEndStopCommand.State = CONTACT_RECOGNIZED signals the end stop has been reached.
  • The axis remains in this state until _disableMovingToEndStop is called, then returns to the prior operation mode.
  • The clamping torque is held precisely; following error settles to the mechanical compression of the stop (typically <1 mm).

This is the cleanest implementation of a "stop at end stop" application. For an unanticipated collision (no pre-known end-stop position), the user must combine torque limiting with a following-error watchdog.

Following Error Handling in Torque Limiting

The most subtle part of torque-limited motion is what happens to the position controller. Two cases:

Case A — positionController ACTIVE

The position controller continues to integrate the position error. The torque cap is hit, the motor cannot advance, the position error grows. The integral term is anti-windup protected (typical of a SIMOTION-typed position controller), but the proportional term still produces a high setpoint, and the drive holds at 90 N·m. Following error grows steadily. After a few hundred milliseconds, a SIMOTION Axis.PositionMonitoring alarm fires (default tolerance is application-defined, often 1 mm or 1°). The axis faults and the motion aborts.

This is the correct behavior for a controlled press — you want a defined following error to confirm contact — but not for a collision reaction.

Case B — positionController INACTIVE

Selecting POSITION_CONTROL_INACTIVE removes the position controller from the loop. The axis is held purely in torque mode at the configured limit. The position error is no longer relevant. The axis remains in this state until _disableTorqueLimiting is called.

For an emergency collision stop, Case B is the correct choice. Pair it with a time-out (e.g. 200 ms) so the controller does not dwell in torque mode indefinitely if the obstacle is permanent.

Implementation Example: Collision Detection Pattern

The following ST snippet is a representative implementation for SIMOTION that detects a collision during a positioning move and reacts by engaging torque limiting.

VAR
    myAxis            : TO_SynchronousAxis;       // axis reference
    motionInProgress  : BOOL;
    collisionDetected : BOOL;
    followingErrorLimit : LREAL := 0.01;          // 1 mm trip threshold
    collTorqueLimit     : LREAL := 90.0;          // N·m clamp
    collHoldTime        : TIME  := T#200ms;
    collTimer           : TON;
    torqueFraction      : LREAL := 0.8;           // 80% of clamp as trip level
END_VAR

// 1) Detect when a positioning move is in progress
IF myAxis.MotionStateData.MotionCommand = MC_MOVE_ABSOLUTE
   AND myAxis.MotionStateData.State = MOTION_RUNNING THEN
    motionInProgress := TRUE;
    collisionDetected := FALSE;
END_IF;

// 2) Collision signature: high torque AND rising following error
IF motionInProgress
   AND ABS(myAxis.PositionFollowingError) > followingErrorLimit
   AND ABS(myAxis.actualTorque) > (torqueFraction * collTorqueLimit) THEN
    IF NOT collisionDetected THEN
        collisionDetected := TRUE;

        // Engage SIMOTION-managed torque limit
        _enableTorqueLimiting(
            axis                := myAxis,
            torqueLimit         := collTorqueLimit,
            positionControlMode := POSITION_CONTROL_INACTIVE);

        // Ramp velocity to zero; torque clamp holds the axis
        _stop(axis := myAxis, deceleration := 10000.0);
    END_IF;
END_IF;

// 3) Time-out: release torque limit after 200 ms
collTimer(IN := collisionDetected, PT := collHoldTime);
IF collTimer.Q THEN
    _disableTorqueLimiting(axis := myAxis);
    _reset(axis := myAxis);
    collisionDetected := FALSE;
    motionInProgress  := FALSE;
END_IF;

Notes on the snippet:

  • The combination of high torque + rising following error is a robust collision discriminator. Pure torque spikes occur on normal load steps; pure following error occurs on a sluggish drive. Both together is the reliable indicator.
  • POSITION_CONTROL_INACTIVE is the correct choice for a collision reaction (Case B above).
  • _stop brings the velocity to zero; the torque limit keeps the motor at the clamp until the timer expires.
  • _reset is needed to clear the residual axis error state after the time-out.
  • Adjust followingErrorLimit and torqueFraction to suit the application's mechanical compliance and the axis' Kv setting.

Configuration Reference

SINAMICS Drive (Closed-Loop Control)

P# Name Type Notes
P1520 Torque limit upper / source Float or CO Set 0 to disable; otherwise N·m or %
P1521 Torque limit lower / source Float or CO Negative-side clamp
P1522 Torque limit upper scaling % Multiplies P1520
P1523 Torque limit lower scaling % Multiplies P1521
r1525 Torque limit upper (active) Float Currently applied upper limit
r1526 Torque limit lower (active) Float Currently applied lower limit
r0080 Actual torque Float Read by SIMOTION for actualTorque
r0081 Torque utilization % Useful as collision discriminator

SIMOTION Axis (Technology Object)

Name Type Notes
UserDefaultTorqueLimiting.TorqueLimit LREAL Default value pre-loaded into the command
UserDefaultTorqueLimiting.PositionControlMode Enum POSITION_CONTROL_ACTIVE or POSITION_CONTROL_INACTIVE
TorqueLimitingCommand.State Enum ACTIVE / INACTIVE / ABORTED
TorqueLimitingCommand.Error BOOL Command-side error
actualTorque LREAL Live torque, from r0080
PositionFollowingError LREAL Live position error
Axis.PositionMonitoring.ToleranceWindow LREAL Following-error trip threshold

Commissioning Steps

  1. Verify drive basic commissioning. Confirm the drive reports motor torque in r0080 and responds to changes in P1520 during standstill (use STARTER/SIMOTION SCOUT trace to confirm).
  2. Enable the axis in SCOUT/TIA Portal, configure the position-controller gains (Kv), and verify the axis can be jogged without faults.
  3. Add _enableTorqueLimiting to the MCC chart (or ST program). Set torqueLimit to a value above the maximum expected normal load (typically 1.5–2× rated running torque) to avoid false trips.
  4. Configure the HMI. Display UserDefaultTorqueLimiting.TorqueLimit and actualTorque so the operator can see the active clamp.
  5. Run a controlled test. Drive the axis against a known stop (a metal block clamped in a vise) at low speed. Confirm the command goes ACTIVE and the trace shows torque rising to the configured limit.
  6. Confirm position-controller behavior. With POSITION_CONTROL_INACTIVE, verify the axis does not raise a following-error alarm during the test. With POSITION_CONTROL_ACTIVE, raise the alarm threshold so contact time is below the threshold.
  7. Run an unanticipated-collision test. With the axis at a normal speed, drive it into the obstacle. Confirm the collision-detection logic engages the torque limit, velocity ramps to zero, and the axis holds for the configured dwell before releasing.
  8. Document the operational envelope. Record the torque limit, position-controller mode, hold time, and position-monitoring tolerance for the maintenance crew.

Verification Checklist

  • [ ] r1525 / r1526 read-back matches the configured limit during TorqueLimitingCommand.State = ACTIVE.
  • [ ] actualTorque trace is smooth (no oscillations >20 % of the limit) during the dwell — high ripple indicates the position controller is fighting the limit.
  • [ ] Following error settles to a constant value (POSITION_CONTROL_ACTIVE) or is irrelevant (POSITION_CONTROL_INACTIVE) during the dwell.
  • [ ] _disableTorqueLimiting returns the axis to the prior operation mode without raising an alarm.
  • [ ] On real collisions, the axis halts within the expected stopping distance at the configured torque limit.
  • [ ] The trace shows r0081 (torque utilization) saturated at the configured clamp — confirms the drive is actually limiting.
  • [ ] HMI shows the active limit matching the drive parameter (P1520 read-back matches the SIMOTION UserDefaultTorqueLimiting.TorqueLimit).

Troubleshooting Matrix

Symptom Probable cause Action
Axis faults with F07452 / F07453 during contact Position controller ACTIVE; following error too large Switch to POSITION_CONTROL_INACTIVE or raise PositionMonitoring.ToleranceWindow (only if mechanically safe)
Torque never reaches the configured limit Load is below the limit, or P1520 is overridden by a lower drive-side limit (r1525/r1526) Read r1525/r1526, check drive data set selection, verify the active motor data set matches the configuration
TorqueLimitingCommand.State stays INACTIVE Command dispatched with wrong axis reference, or axis is in a state that disallows torque limiting (faulted, not homed, in synchronous mode with active cam) Verify Axis.StateControl permits the command; clear faults; home the axis; check the active operation mode
Axis overshoots the obstacle on collision Hold time too short, or POSITION_CONTROL_INACTIVE not selected and the position controller has wound up Extend the dwell; switch the position-controller mode; add a velocity ramp on the underlying positioning command
HMI shows the wrong torque unit Axis configured with a torque scaling factor different from the drive (Nm vs lbf·in) Verify the torque unit in the axis configuration matches the drive (N·m)
actualTorque reads negative on a positive load Sign convention of the drive vs the axis Invert in the application code or set P1520/P1521 signs correctly
Drive alarms F07901 / F07902 on contact Motor stalled protection trips because the motor is held at zero speed with torque Increase the stall monitoring time, or use a dedicated torque-limit command (which is exempt from stall protection in most firmware versions)

Common Pitfalls

Do not write P1520 at runtime without a follow-up axis command. A direct P1520 write is appropriate for commissioning, but in production code it is a latent fault. Always use the SIMOTION-managed path so the axis state machine is consistent with the drive's clamp.
Do not leave the default position-monitoring tolerance (1 mm) on a press-fit axis. The compression of the mechanical stop will exceed 1 mm; the axis will fault on first contact. Raise the tolerance to the worst-case mechanical compression plus a safety margin, or use POSITION_CONTROL_INACTIVE.
Do not use _enableTorqueLimiting for a long dwell on a hard stop. Use _enableMovingToEndStop instead. The travel-to-endstop command is designed for press-fit and clamping applications and handles the contact recognition, the dwell, and the release in one primitive.

Edge Cases and Field-Commissioning Notes

Sinusoidal commutation and resolver offset. On resolvers and absolute encoders with a small offset error, the first few cycles of torque limiting can produce a torque oscillation at the commutation frequency. Verify the encoder alignment in STARTER's "Commutation" panel before commissioning torque limits.

Drive data set switching. If the application switches motor data sets (DDS) — for example, between a low-speed high-torque motor and a high-speed low-torque motor — the active P1520 changes with the data set. Read r1525 after every DDS switch to confirm the active clamp.

Safety Integrated interaction. On drives with Safety Integrated (SI) enabled, the Safe Torque Off (STO) and Safe Stop 1 (SS1) functions take priority over the application-level torque limit. When the safety function is active, P1520 is bypassed. Verify the safety configuration does not inadvertently drop the torque limit during normal operation.

Torque ripple on a screw-driven axis. A pre-loaded ball screw produces a sinusoidal torque ripple at the pitch frequency. If r0081 shows >10 % ripple, the contact detection will be unreliable. Add a low-pass filter on the torque signal in the application code, or use the drive-side torque-smooth function (p1730 in SINAMICS S120).

Multi-axis gantries. On a gantry, the torque limit must be applied to the leading axis, not to each slave independently, otherwise the slaves will fight each other on contact. SIMOTION's gantry coupling is set up at the technology-object level; torque limiting is then a property of the gantry, not of the individual axes.

Platform Comparison — Rockwell Home to Torque Limit

For engineers cross-platforming to Allen-Bradley / Studio 5000, the equivalent pattern is the Home to Torque Limit Sequence in Studio 5000 / Logix Designer. Rockwell provides an Add-On Instruction (MAAT_HomeToTorqueLimit) that performs a homing sequence against a mechanical hard stop using the axis' torque-limit attribute, with full documentation available from the Rockwell Automation Innovation Center: Home to Torque Limit Sequence in Studio 5000. The high-level pattern is identical to SIMOTION: drive into the stop, monitor torque, detect contact, set position to a fixed offset. SIMOTION's _enableMovingToEndStop and Logix's MAH (Motion Axis Home) with torque-limit-on-contact are the two vendors' canonical solutions to the same problem. The cross-platform mapping is summarized below.

Concern SIMOTION Logix Designer (Studio 5000)
Hard-stop homing command _enableMovingToEndStop MAH with TorqueLimit
Generic torque-limited motion _enableTorqueLimiting MSO with torque cap, or MCD motion direct command
Drive-level clamp P1520 / r1525 Axis.TorqueLimit attribute (mapped to drive by the AOI)
Collision reaction Position-error + torque watchdog MotionFault on position error
Following-error tolerance PositionMonitoring.ToleranceWindow PositionErrorTolerance attribute
Stop primitive _stop MSS (Motion Axis Stop)
Reset primitive _reset MASR (Motion Axis Shutdown Reset)

Notes on Functional Safety

The torque-limit mechanisms described in this article are not safety-rated. Where the hazard is "axis contacts a person", the requirement is a category-1 (or higher) stop on a safety door or a Safe Torque Off (STO) on the drive. SIMOTION provides safety integration via F-CPU and SINAMICS Safety Integrated; the _enableTorqueLimiting and P1520 mechanisms are operational, not safety-rated. Do not use them in the safety chain. Reference: SIMOTION Safety Integrated Manual at SIMOTION Manual Collection.

FAQ

What is the difference between P1520 and _enableTorqueLimiting on SIMOTION?

P1520 is a SINAMICS drive parameter that directly clamps the torque in the closed-loop control block. _enableTorqueLimiting is a SIMOTION MotionCommand that writes P1520 for you and, crucially, manages the axis state machine — anti-windup on the position controller, status reporting via TorqueLimitingCommand.State, and a controlled exit path. Using P1520 alone is not a stop: the axis will grind against the obstacle, the position error will grow, and a following-error fault will trip.

Will the axis actually stop if I just set P1520 = 90 Nm?

No. P1520 only clamps the motor torque. The SIMOTION axis is still under a positioning command, the speed setpoint remains, the position controller keeps integrating, and the following error grows until the position monitoring trips. To stop the axis, dispatch _enableTorqueLimiting (or _stop) and either select POSITION_CONTROL_INACTIVE or extend the position-monitoring tolerance.

Which MotionCommand should I use to press a tool into a fixture?

Use _enableMovingToEndStop (Travel to fixed endstop). It drives the axis against a known mechanical stop with a defined clamping torque, recognizes contact, and holds the axis in place. _enableTorqueLimiting is for unanticipated collisions or general torque clamping during a motion, not for hard-stop press-fit applications.

How do I detect a collision during a normal positioning move?

Combine a high-torque threshold (e.g. 0.8 × configured running torque) with a following-error threshold (e.g. 1 mm) on the axis. When both are exceeded, engage _enableTorqueLimiting with POSITION_CONTROL_INACTIVE, issue a _stop with a high deceleration, and dwell for a configured time (200 ms is typical) before clearing with _disableTorqueLimiting and _reset.

What follow-up error or alarm should I expect during torque limiting?

With POSITION_CONTROL_INACTIVE, no position-monitoring alarm is raised. With POSITION_CONTROL_ACTIVE, the position error will grow to a steady-state value (typically the compliance of the mechanical stop); configure PositionMonitoring.ToleranceWindow high enough to allow the expected compression. A common mistake is leaving the default tolerance (1 mm or 1°) which trips immediately on contact.

Can torque limiting be used in a safety-rated function?

No. P1520 and _enableTorqueLimiting are operational, not safety-rated. For hazard zones that require a person-safe stop, use a category-1 (or higher) safety stop with a safety door, or Safe Torque Off (STO) / Safe Stop 1 (SS1) on the drive via SINAMICS Safety Integrated and a SIMOTION F-CPU.

Back to blog