Releasing SINAMICS Servo Brake via SIMOTION Telegram 105 PZD

David Krause18 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

SIMOTION D4x5 controllers integrate a SINAMICS S120 drive module on the same backplane, allowing motion, logic, and drive closed-loop control to share a single hardware platform. Telegram 105, PZD-10/10 is a Siemens-specific PROFIdrive telegram that extends the standard positioner telegram by additional control and status words, and it is one of the most widely used telegrams on SIMOTION D with integrated SINAMICS. It supports the basic positioner (EPOS), speed control, and torque control modes through the same word layout, which is why the brake control word is co-located in the first control word (STW1) of the drive.

Servo motors with integrated holding brakes are mandatory for vertical axes, suspended loads, and any axis that must hold position after the controller is de-energized. The brake is normally controlled by the drive sequence control: the drive opens the brake before enabling torque, and closes it after disabling torque. When the application requires the brake to be opened or closed directly from the application program without traversing the standard enable sequence, the developer must override the sequence-controlled bit (bit 12 of STW1) through a SIMOTION system function. This article documents that exact procedure, including the parameter bitmask, the working code snippet, the parameter p1215 configuration, the failure mode that produces error 20005 reason 4, and the firmware compatibility matrix that has been validated in the field.

Safety notice: Manual brake override removes the standard sequence-controlled interlock between enable and torque. The application must ensure that opening the brake while the axis is not enabled does not allow a suspended load to drop. Always confirm that the mechanical system is safe for the requested brake state, and use a redundant hardware interlock on vertical or hazardous axes.

Prerequisites

Implement this procedure only on a system that matches the following reference configuration. Substituting other telegrams or hardware variants changes the bit layout and will not produce the expected result.

  • Controller: SIMOTION D435 (or D425, D445, D455 with integrated SINAMICS S120). The same procedure also works on the SIMOTION D4x5-2 DP/PN variants with the same integrated drive firmware.
  • Drive: SINAMICS S120 (integrated on the SIMOTION D435) or external CU320-2 + S120 with a CX32 controller extension, configured for a 1FK7 / 1FT7 / 1PH8 / 1FL6 servo motor with motor holding brake.
  • Configuration tool: SIMOTION SCOUT (SCOUT TIA is not supported for this workflow; SCOUT classic V4.x or V5.x is required for the project engineering and the function block library).
  • Firmware: SIMOTION D4x5 firmware V4.1.1.6 or higher. The bit 12 override behavior was confirmed working in V4.1.1.6; earlier V4.0, V4.1.0.x, and V4.1.1.0 to V4.1.1.5 firmware revisions can refuse the override while the axis is enabled and return error 20005 reason 4.
  • Telegram: Siemens telegram 105, PZD-10/10. Confirm under Drive > Communication > Telegram configuration in SCOUT that the telegrams on the drive side and the SIMOTION side are identical and online-consistent.
  • Brake connection: The motor holding brake must be wired to the SINAMICS brake output (typically X7 on SINAMICS S120 booksize or X9 on the integrated drive) and the brake must be configured under Drive > Motor > Brake with the correct rated voltage, current, and opening/closing times.
  • Programming language: The example below uses Structured Text (ST) inside a SIMOTION program. The same _setaxisstw call is also available from MCC (LAD/FBD equivalent) and from the ST equivalents inside the LAdderDiagram editor.

Telegram 105 PZD-10/10 Word Layout

Siemens telegram 105 reserves ten process data words in each direction. The receive direction (controller → drive) carries two control words, a primary setpoint, and additional control/status flags. The send direction (drive → controller) mirrors the structure with two status words. The brake-related bit is in the first control word of the receive direction, mapped to bit 12.

Receive direction PZD 10/10 (controller → drive)
PZD word Name Width Function
PZD1 STW1 16 bit Control word 1 (contains brake open/close bit 12)
PZD2 NSOLL_B 16 bit Speed setpoint (with sign) in positioner mode or speed setpoint in speed mode
PZD3 STW2 16 bit Control word 2
PZD4 G1_STW 16 bit Encoder 1 control word / positioner control
PZD5 G2_STW 16 bit Encoder 2 control word / positioner control
PZD6…PZD10 Position / override / MDI 16 bit each Position setpoint, override, MDI blocks, depending on mode

Only PZD1 (STW1) is relevant for the brake override. The other words must be untouched to avoid disturbing the positioner or speed control state machine.

STW1 Bit 12 — The Holding Brake Override Bit

In the SINAMICS S120 drive, control word 1 is defined per PROFIdrive profile and extended by Siemens with manufacturer-specific bits. The bit relevant to manual brake control is bit 12. The bit weight is 212 = 4096 decimal (0x1000).

STW1 bit map relevant to brake control
Bit Weight (dec) Hex Name Brake meaning
0 1 0x0001 ON / OFF1 Sequence-controlled ramp down; brake closes at the end of ramp
1 2 0x0002 OFF2 Coast to stop; brake closes
2 4 0x0004 OFF3 Quick stop; brake closes
3 8 0x0008 Enable operation Pre-condition for any torque generation
4…6 16/32/64 0x0010…0x0040 Ramp-function generator Not used for brake
7 128 0x0080 Acknowledge fault Resets drive faults
8…9 256/512 0x0100/0x0200 Jog 1 / Jog 2 Not used for brake
10 1024 0x0400 Control by PLC Must be set when the controller is the active source of setpoints
11 2048 0x0800 Reverse direction Not used for brake
12 4096 0x1000 Open holding brake (Siemens-specific) 1 = open, 0 = close, only effective when p1215 = 1
13…15 8192…32768 0x2000…0x8000 Manufacturer-specific Reserved in telegram 105

When the drive parameter p1215 = 1 (sequence control), the drive itself normally drives bit 12 to 1 when the enable sequence reaches the point where torque is allowed, and drives it to 0 when the sequence shuts torque off. Writing bit 12 directly from the application program therefore competes with the drive sequence control. The _setaxisstw system function resolves that conflict by using a write mask that overrides only the selected bits for one cycle.

The _setaxisstw System Function

_setaxisstw is a SIMOTION runtime function (system function) that writes a bitmask into the axis control word. The mask and the value are processed together: every bit set to 1 in stw1bitmask forces the corresponding bit in the axis control word to the value supplied in stw1bitset; all other bits are left unchanged and the drive sequence control continues to own them. The function is available for all TO types that have a control word 1 (TO axis, external encoder, following axis, cam).

_setaxisstw formal signature
Parameter Direction Type Description
axis IN AXIS_REF Axis reference; usually the symbolic name of the TO in SCOUT
stw1bitmask IN DWORD Bitmask selecting which STW1 bits to overwrite (4096 = bit 12 only)
stw1bitset IN DWORD Bit values to apply to the selected bits (4096 = 1, 0 = 0)
stw2bitmask IN DWORD Bitmask for STW2, optional (default 0)
stw2bitset IN DWORD Bit values for STW2, optional (default 0)
execution IN DWORD TO_EXECUTION (continue execution) or TO_ABORT (abort on first error)
returnValue RETURN DWORD 0 = success, 1 = function cannot be executed, error in the diagnostic buffer

Function block reference and parameter descriptions are documented in the SIMOTION SCOUT help file and the SIMOTION system function manual. SCOUT auto-generates the function call from the LadderDiagram, MCC chart, or the ST editor if you insert the function from the library “System > Axis > _setaxisstw”.

Brake Configuration Parameter p1215

The drive parameter p1215 selects the source and the mode of the motor holding brake. The valid values for the manual override described in this article are restricted to p1215 = 1 only.

Brake configuration source for SINAMICS S120
p1215 Brake control source Manual override possible Notes
0 No brake present No Set only when the motor has no brake; writing bit 12 has no effect
1 Sequence control (drive controls brake using internal state machine) Yes — this is the only valid setting for manual override Brake opens when the drive is enabled and torque is allowed; closes on disable / fault
2 Reserved No Do not use
3 Brake control via BICO bit p1216[0] Yes, but routed through BICO Bit 12 override is masked by BICO; use BICO instead
4 Reserved No Do not use
5 Brake control via DI / digital input on the drive No Use a hard-wired safety path instead of the controller
10…19, 1000+ External / safety-related brake control No Used for SIMOTION Safe Brake Control, leave to the safety engineering

Inspect p1215 and the related opening/closing time parameters p1216 (start of opening) and p1217 (closing time) before commissioning. A misconfigured p1217 is one of the most common reasons a brake appears to “slip” when the override is applied for the first time.

Step-by-Step Implementation

  1. Confirm telegram 105, PZD-10/10. In SCOUT, open the project, navigate to the drive under Drive > Communication > Telegram configuration, and verify the entry “SIEMENS telegram 105, PZD-10/10” on both the drive side and the SIMOTION side. Download the project to the controller and run a consistency check.
  2. Configure the brake under p1215. Open the drive expert list, navigate to p1215, set the value to 1 (sequence control). Adjust p1216, p1217, and the rated brake current according to the motor data sheet.
  3. Update the SIMOTION firmware to V4.1.1.6 or higher. Use SIMOTION Updater to flash the D435 to firmware V4.1.1.6 or later. Earlier firmware may reject the override while the axis is enabled. The update procedure is documented in the SIMOTION D4x5 Commissioning and Hardware Installation Manual.
  4. Create a program unit in SCOUT. Add a new program unit, declare a variable of type AXIS_REF and assign it to the axis that drives the brake motor. Then add a function block or a ST source that contains the _setaxisstw call.
  5. Insert the working code. Use the following ST snippet as the body of a cyclic or triggered task. The bitmask is 4096 and the bitset value is 4096 to force bit 12 to 1 (open the brake). To close the brake, set the bitset to 0 while keeping the mask at 4096.
// ST source — unconditional brake release / close
// Axis reference Achse_1 declared as AXIS_REF in the unit interface

RetDint : DINT;

// Open the brake unconditionally
RetDint := _setaxisstw(
    axis        := Achse_1,
    stw1bitmask := 4096,           // 0x1000 = bit 12 only
    stw1bitset  := 4096,           // bit 12 = 1 (open brake)
    stw2bitmask := 0,              // leave STW2 untouched
    stw2bitset  := 0,
    execution   := TO_EXECUTION);

IF RetDint <> 0 THEN
    // Handle error in the diagnostic buffer
    _writeAxisDiagData(axis := Achse_1);
END_IF;
  1. Add the close-brake branch. Whenever the application requires the brake to be closed without disabling the axis, repeat the call with the bitset set to 0. The mask of 4096 ensures that no other bit of STW1 is changed, so the enable state, the on/off state, and the ramp-function generator remain owned by the drive sequence control.
// Close the brake while the axis remains enabled
RetDint := _setaxisstw(
    axis        := Achse_1,
    stw1bitmask := 4096,           // mask: bit 12 only
    stw1bitset  := 0,              // bit 12 = 0 (close brake)
    stw2bitmask := 0,
    stw2bitset  := 0,
    execution   := TO_EXECUTION);
  1. Compile and download. Compile the program unit, ensure the axis and the drive are online-consistent, and download the configuration. Use the online Control panel in SCOUT to verify that the bit toggles correctly before the application code runs in automatic.
  2. Run a controlled test. With the axis safely decoupled, observe the bit in the online monitor and confirm the brake click and the drive parameter r0898 (status word of the sequence control, bit 12 reflects the brake state). The drive parameter r0080 can also be used to verify torque availability.

Error 20005 Reason 4 — Diagnosis and Recovery

SIMOTION reports technology object errors through the error number 20005, which appears in the axis diagnostic buffer and in the SCOUT online “Error” view. Reason 4 is the diagnostic for the brake-state conflict that occurs when the drive sequence control and the controller program attempt to drive bit 12 to opposite values during an enable transition. The error disables the affected axis and must be acknowledged before further motion is allowed.

Error 20005 reasons relevant to brake handling
Reason Trigger Recovery
1 Axis enable attempted while a higher-level enable is missing Check the safety chain and the controller-level enable inputs
2 Drive fault active Acknowledge the drive fault and re-enable the axis
3 Setpoint timeout (SIMOTION → drive) Check the telegram mapping and the bus cycle time
4 Brake control bit conflict (bit 12 set by the controller while drive is in a brake-active state, or firmware older than V4.1.1.6) Update to SIMOTION V4.1.1.6 or higher; ensure p1215 = 1; use _setaxisstw with mask 4096
5 Follow-up / position controller initialization Wait for the controller to finish its first ramp and retry
7 Encoder configuration invalid Reconfigure the encoder in SCOUT and re-download
11 Axis crossed into a software limit Move the axis back into the working range and re-enable

If error 20005 reason 4 appears, do the following in order:

  1. Acknowledge the error through the axis error acknowledge mechanism in the calling program (e.g., _enableAxis after the diagnostic buffer is cleared, or the “Acknowledge axis error” on the axis operator panel in SCOUT).
  2. Check the drive fault buffer and the SIMOTION diagnostic buffer. Both are needed because the error is raised on the SIMOTION side based on the drive status word and the controller sequence.
  3. Verify the firmware version of the SIMOTION D4x5 in the online Target system > Device diagnostics > Firmware view. If it is older than V4.1.1.6, schedule a maintenance window to flash the controller.
  4. Confirm p1215 = 1 and that no other write source is also driving bit 12. A common fault is a BICO interconnection from a digital input to p1216[0] that overwrites the controller write.

Firmware Compatibility Matrix

The behavior of _setaxisstw while the axis is enabled is firmware-dependent. The following matrix summarizes the field-validated cases on SIMOTION D435 with integrated SINAMICS S120, telegram 105, PZD-10/10.

Behavior of STW1 bit 12 override by firmware
SIMOTION firmware Axis disabled → set bit 12 = 1 Axis enabled → set bit 12 = 1 Axis enabled → set bit 12 = 0 Recommended
V4.0.x Works Bit 12 ignored; brake state remains Returns error 20005 reason 4 No
V4.1.0.x Works Bit 12 ignored Returns error 20005 reason 4 No
V4.1.1.0 Works Bit 12 ignored Returns error 20005 reason 4 No
V4.1.1.5 Works Inconsistent across integrated drive FW revisions Returns error 20005 reason 4 No
V4.1.1.6 Works (brake opens) Works (brake state can be forced) Works (brake closes on next cycle) Yes
V4.2.x and higher Works Works Works Yes

The official field-tested combination documented in the original engineering record is SIMOTION V4.1.1.6 with the standard SINAMICS S120 drive firmware shipped on the D435 at that time. Newer SIMOTION versions (V4.2, V4.3, V4.4, V5.x) preserve the behavior.

Verification Procedure

Run the following checks after the code is downloaded and the axis is online.

  1. Static check — brake open. Trigger the open-brake call from a one-shot task. Use SCOUT “Monitor” on the variable Achse_1.stw1 (or the corresponding axis tag from the axis interface). Bit 12 must be 1 within one IPO cycle. Listen for the mechanical brake click; check that the motor shaft can be turned by hand before the axis is enabled.
  2. Static check — brake close. Trigger the close-brake call. Bit 12 must drop to 0 within one cycle. The motor shaft must be held; a torque of 5…10 Nm is normally enough to confirm the brake is engaged.
  3. Dynamic check — enable → force open → force close. Enable the axis, hold a stationary position, then trigger the close-brake call. No error 20005 reason 4 should appear. The drive parameter r0898.12 should report 0. Re-issue the open-brake call to confirm the bit toggles back to 1.
  4. Diagnostic buffer check. In SCOUT, open Target system > Axis > Diagnostic buffer. The buffer should not contain any new 20005 entry during the test sequence. Any new entry indicates a conflict source (BICO, F-DI, or duplicate write).
  5. Online telegram check. In the drive online diagnostics, open the telegram trace and verify that PZD1 actually carries the modified bit 12. A bus-side trace is also recommended for systems where the fieldbus (PROFINET IRT, PROFIBUS DP) is suspected to be the source of an inconsistency.

Drive Parameter Reference

Parameters used in the brake override
Parameter Read / Write Value used Description
p1215 R/W 1 Brake control source: sequence control (manual override possible)
p1216 R/W Motor data sheet Brake opening time threshold
p1217 R/W Motor data sheet Brake closing time
p1218[0..n] R/W From BICO Signal source for the brake, used when p1215 = 3
r0898.12 R Monitor Status bit 12 of the sequence control (brake open request)
r0080 R Monitor Torque availability, used to confirm the drive is in a torque-allowed state
r0046.31 R Monitor Drive “brake released” status, useful for cross-check

Common Pitfalls and Field Notes

  • Mask interpretation. stw1bitmask is a write mask, not a “set to one” mask. A bit set to 1 in the mask tells the runtime “overwrite this bit”; the actual value is taken from stw1bitset. Both parameters must be set explicitly.
  • Do not write the entire STW1. Setting the mask to 0xFFFF would overwrite the enable bits and the ramp generator bits, effectively disabling the axis or starting a stop ramp. Always restrict the mask to 4096.
  • BICO interconnections. If a digital input on the drive is wired to p1216[0], the drive and the controller will fight for control of bit 12. Either remove the BICO source or change p1215 to 3 and route the controller through BICO instead of using _setaxisstw.
  • Brake type. Power-off brake (normally engaged, released by power) and power-on brake (normally open, engaged by power) behave identically from the controller side, but the timing is opposite. A power-on brake will release the moment the controller is de-energized; this is the safer default for suspended loads and is the most common choice for SINAMICS 1FL6 / 1FK7 motors.
  • Safe Brake Control (SBC). On systems that use SIMOTION Safe Brake Control, the safety brake is on a separate path and is not affected by the _setaxisstw override. The manual override described in this article affects the standard (non-safety) brake only.
  • Test bench first. Always run the override on a test bench or a decoupled axis before connecting a load. A premature brake close with a moving load can generate a mechanical shock that destroys the gearbox.
  • STW1 and STW2 swap. Some telegrams swap the order of STW1 and STW2. Telegram 105 always places STW1 in PZD1, so the procedure described in this article is stable on telegram 105 only. Do not copy the code to a system that uses telegram 1, 2, 3, 4, 5, 6, 7, 9, 110, 111, 116, 118, or 125 without verifying the new word layout.

Application Variants

The same bit override scales to three common industrial scenarios.

Application variants of the STW1 bit 12 override
Scenario Why the override is needed Additional code
Vertical axis, controlled lowering without torque Hold the load with the brake while the axis is still enabled and the controller is being debugged Block _enableAxis and any _pos / _move call until the brake state matches the expected value
Test bench — mechanical check Verify the brake engages and releases on demand without driving the motor Sequence the override through a state machine; verify r0898.12 after each step
Servo press, open-loop torque pre-check Open the brake briefly to pre-position the press slide before the motion cycle starts Combine with _resetAxisError and a watchdog that re-closes the brake if the cycle does not start in time

Frequently Asked Questions

Which bit of STW1 forces the holding brake open on telegram 105?

Bit 12 of STW1, which is decimal 4096 (0x1000). In _setaxisstw set stw1bitmask := 4096 and stw1bitset := 4096 to open the brake; set stw1bitset := 0 to close it. This requires p1215 = 1 on the SINAMICS S120 drive.

Why does error 20005 reason 4 appear when the axis is already enabled?

Reason 4 is the SIMOTION diagnostic for a brake-state conflict. On SIMOTION firmware older than V4.1.1.6, writing bit 12 while the axis is enabled is rejected and the axis is disabled. Updating SIMOTION to V4.1.1.6 (or higher) and using the documented _setaxisstw call resolves the error.

Do I need to change p1215 to use this override?

Yes. p1215 must be 1 (sequence control). p1215 = 0 means no brake; p1215 = 3 uses a BICO source for the brake and ignores the controller write; p1215 = 5 uses a digital input on the drive; p1215 >= 10 is reserved for safe brake control. Only p1215 = 1 allows the manual override described here.

Can I use _setaxisstw on other telegrams such as 1, 2, 3, 5, or 110?

Bit 12 of STW1 has the same meaning in every SINAMICS PROFIdrive telegram, but the word order and the position of STW1 inside the PZD block can change. Telegram 105 places STW1 in PZD1 and is the only telegram that has been field-validated with this code. For telegram 5, the procedure is similar but the mask must still be 4096, while for telegram 1 or 2 STW1 may not include bit 12 in the same way. Re-validate the layout before copying the code to a different telegram.

Is the safety brake affected by the override?

No. The override acts on the standard (non-safety) holding brake through STW1 bit 12. Safe Brake Control (SBC) uses a separate signal path on the SINAMICS S120 and is not touched by _setaxisstw. The safety brake is owned by the safety program and must not be overridden from the standard application.

Back to blog