Overview
The Siemens S7-1500 and S7-1500T CPU families expose the TO_PositioningAxis technology object (TO) as a unified motion primitive for both electric and hydraulic axes. When the same TO is bound to a hydraulic proportional valve through an analog output (AQ) module and a contactless magnetostrictive position sensor is used for feedback, the commissioning engineer must reconcile three independent parameter sets before MC_MoveJog can be executed without a positioning alarm: encoder configuration, mechanical lead/pitch, and the valve characteristic curve managed by the SIMA Hydraulics library.
This reference consolidates the field-proven procedure for clearing the positioning fault, reading the <TO>.ErrorWord tag to identify the alarm group, and configuring the SIMA Hydraulics function blocks so the controller can drive the proportional valve with a compensated setpoint. The same procedure applies to S7-1500T axes with an additional load-side encoder, with the proviso that the T-CPU exposes an extra ActualPosition2 tag for the second feedback channel.
ErrorWord structure; cross-check against the version-specific TIA Portal Help if you are on V17 or earlier.Architecture: TO_PositioningAxis Driving a Hydraulic Proportional Valve
The TO_PositioningAxis is normally configured for electric drives that use PROFIdrive over PROFINET or an analog setpoint interface. The TO is also suitable for hydraulic proportional valves that accept a voltage or current command. The PLCopen motion-control instructions (MC_Power, MC_MoveJog, MC_MoveAbsolute, MC_MoveRelative, MC_Stop, MC_Halt, MC_Reset) operate identically; the differences are in the data block parameters of the TO and the addition of the SIMA Hydraulics function blocks in the user program.
When the axis is bound to a hydraulic proportional valve, the closed-loop controller inside the TO drives the AQ output, and the actual position is fed back by an SSI or analog magnetostrictive position sensor mounted on the cylinder. Because the hydraulic valve has a dead zone, hysteresis, and a nonlinear flow-vs.-command characteristic, the SIMA Hydraulics library wraps the inner loop with a characteristic-curve compensation block (LSimaHydTO_MC_SetCharacteristic). The outer LSimaHydTO_HydAxisCall runs in the cyclic task and feeds the corrected setpoint into the TO each cycle.
Wiring topology
The CPU publishes the setpoint on the configured AQ channel, the proportional valve driver conditions the current to the valve solenoid, the cylinder moves, and the magnetostrictive sensor returns the actual position on the SSI or AI channel. The TO closes the loop on the actual position value.
Mechanics and Encoder Parameter Configuration
Open Technology objects > TO_PositioningAxis > Configuration > Mechanics in TIA Portal and set the mechanical parameters to match the physical system exactly. The mechanical parameters define how load revolutions are translated into position units and which side of the gearbox the encoder sits on.
| Parameter | Meaning | Typical value (hydraulic cylinder) |
|---|---|---|
| Load gear numerator / denominator | Gear ratio between motor and load (or between cylinder stroke and feedback sensor) | 1 / 1 for direct cylinder mounting |
| Position of the encoder | On motor shaft or on load | On load (recommended for cylinders) |
| Encoder increments per revolution | Resolution of the position sensor (incremental only) | 8192 for SSI-emulated sensors |
| Number of revolutions (multi-turn) | Resolvable range of the sensor | 1 (single-turn) for cylinder stroke |
| Distance per revolution | Linear displacement per sensor revolution | Stroke length in mm (e.g., 500 mm) |
| Modulo | Axis runs modulo N | Disabled for linear cylinder |
| Invert direction | Reverse positive direction | Per physical test |
The most common source of a positioning fault on a hydraulic cylinder is an incorrect Distance per revolution or a wrong Encoder type setting. For a Temposonics RH or Balluff BTL7 magnetostrictive sensor, set the TO to Absolute encoder (SSI) with a data length of 24 or 25 bits and the code type configured per the sensor datasheet (typically gray for SSI). For a sensor with analog output, set the TO to Analog measuring encoder and bind the sensor to an AI module input, then scale the AI range to the cylinder stroke length in the TO's analog scaling parameters.
Verification: open-loop motion test
Disable the position controller (Configuration > Control loop > Position control > Disabled) and run a MC_MoveJog command. If the cylinder extends and retracts proportionally to the jog velocity setpoint, the mechanics and encoder parameters are correct. If the cylinder moves the wrong direction, invert the encoder polarity in the TO configuration. If the cylinder hunts, overshoots, or stops short, re-check the distance-per-revolution value and the load-gear ratio.
Magnetostrictive Position Sensor Setup
Contactless magnetostrictive position sensors (Temposonics RH/RP/EP from MTS Sensors, Balluff BTL7) deliver either an SSI frame, an analog 0-10 V or 4-20 mA signal, or a start/stop pulse. The selection on the TO must match the sensor variant exactly. Resolution is typically 1 to 5 micrometres with a linearity of 0.01% to 0.05% of full stroke, well within the closed-loop accuracy of a hydraulic axis.
| Sensor | Output | TO Encoder type | Wiring notes |
|---|---|---|---|
| Temposonics RH SSI | SSI 24-25 bit | Absolute encoder (SSI) | CLK+/CLK- and D+/D- to SM 1500 SSI module, baud 1 MHz |
| Temposonics RH Analog | 0-10 V or 4-20 mA | Analog measuring encoder | AI 4xU/I/RTD/TC ST module, scale AI range to stroke |
| Balluff BTL7 SSI | SSI 24-25 bit | Absolute encoder (SSI) | Code type = binary, baud 1 MHz, shielded twisted pair |
| Balluff BTL7 Analog | 0-10 V or 4-20 mA | Analog measuring encoder | Calibrate zero and end point with the TO scaling page |
| Start/Stop pulse | Start/stop | Not supported on S7-1500 TO | Use a 3rd-party signal conditioner to convert to SSI |
ErrorWord as a runtime alarm.SIMA Hydraulics Library and Call Order
The SIMA Hydraulics library is published on the Siemens support site as the LSimaHydTO package. It contains the FBs needed to operate a hydraulic axis on top of a standard TO_PositioningAxis. The library documentation entry Library LSimaHydTO lists every function block in the package and their call order. The application example SIMA Hydraulics application example (MC_PreServo) provides a complete TIA Portal project that can be opened, compiled, and adapted.
The LSimaHydTO_MC_SetCharacteristic FB uploads a measured valve characteristic curve into the TO. The FB must be called once at startup, before the cyclic LSimaHydTO_HydAxisCall is called. If the FB is not called, the controller assumes a linear valve curve, and any nonlinearity in the real valve causes a steady-state position error and a positioning alarm during dynamic moves.
Call sequence
- Insert the
LSimaHydTO_MC_SetCharacteristicFB once in OB100 (startup) or a one-shot routine. - Pass the data block or dataset ID that contains the cam table (typically generated by
LSimaHydTO_MC_LearnCharacteristicor imported from a CSV file exported by the SIMA commissioning tool). - Assign the output of the FB to the corresponding hydraulic axis
Axisinput. - Call
LSimaHydTO_HydAxisCallin the cyclic task (OB1 or a servo-equivalent task) so the inner loop is updated each cycle. - Issue
MC_Power.Enable := TRUEand wait forStatusWord.X3 (OperationEnable). - Run
MC_MoveJogwith a low velocity to verify the closed loop.
Library versioning and availability
The library is delivered as a TIA Portal library package (.zip) and can be imported via Options > Global libraries > Open library. Check the release notes in the library package for the minimum TIA Portal version and the minimum CPU firmware required. Library version 2.x targets TIA Portal V17 and later, version 3.x targets TIA Portal V20 and later. Mixing a V20 library with a V17 project is not supported.
ErrorWord Tag and Alarm Groups
The <TO>.ErrorWord tag on a positioning axis aggregates all active technology alarms into a 16-bit WORD. Each bit identifies a specific error group. When the ErrorWord is non-zero, the axis is in an error state and most motion commands are rejected until the cause is cleared and MC_Reset is issued.
For the official description of the ErrorWord tag on the S7-1500/S7-1500T positioning axis, see the Siemens TIA Portal Help: ErrorWord tag (positioning axis) - TIA Portal V20 documentation.
Bit interpretation
While the exact bit mapping is version-specific, the canonical groups on a positioning axis ErrorWord are:
| Bit | Group | Typical cause |
|---|---|---|
| 0 | Configuration error | Encoder type, gear ratio, or TO data block not consistent |
| 1 | User / command error |
MC_MoveJog issued while axis is disabled or in error |
| 2 | Runtime error | Following error exceeded, hardware limit switch reached, SSI frame error |
| 3 | Positioning error | Target window not reached, dynamic limits violated |
| 4-7 | Reserved / additional groups | Per TIA Portal Help |
| 8-15 | Reserved / axis-specific | Per TIA Portal Help |
Companion tags
When the ErrorWord indicates a non-zero group, use the following tags to drill down:
-
<TO>.ErrorDetail- DWORD with the detailed error code -
<TO>.ErrorAdditionalInfo- additional context such as the failing parameter ID -
<TO>.ErrorReaction- the reaction the controller took (e.g. stop with ramp, immediate stop) -
<TO>.WarningWord- WORD with non-fatal warnings -
<TO>.StatusWord- WORD with axis state bits
Position Controller Tuning (Kv Gain)
The TO_PositioningAxis closes the position loop with a P-action controller. The proportional gain is expressed as the velocity gain Kv in units of (1/s) or as a direct loop gain. The closed-loop bandwidth and the steady-state position error are linked by:
v_setpoint(t) = Kv * e(t)
where e(t) = position_setpoint(t) - position_actual(t). A higher Kv reduces the steady-state error but increases the closed-loop bandwidth, which can excite hydraulic resonances around 30-80 Hz that are common in long-bore cylinders. A lower Kv damps the loop but leaves a steady-state offset that the SIMA cam characteristic must correct.
Field-proven starting point for a hydraulic cylinder:
-
Kv= 1 to 5 (1/s) for a soft, well-damped axis -
Kv= 5 to 15 (1/s) for a stiff, high-response axis - Acceleration limit = 0.5 to 2 m/s^2 for the first commissioning run
- Velocity limit = 50% of the valve rated flow for the first commissioning run
Reduce Kv in 10% steps if the axis oscillates at the target position. Increase Kv in 10% steps if the axis approaches the target slowly or leaves a steady-state offset after the cam characteristic has been applied.
MC_MoveJog Commissioning Procedure
Once the mechanics, encoder, and SIMA Hydraulics parameters are loaded, commission MC_MoveJog in the following order. Each step is a gating condition for the next.
-
Verify
MC_Power.Enableis TRUE and the TO has reached the Standstill or Discrete Motion state. ReadStatusWord.X3 (OperationEnable)andStatusWord.X7 (HasError). -
Set Velocity and JogDuration in the
MC_MoveJoginstance. Start with a low velocity (5% of the configured maximum) andJogDuration= 0 (continuous jog while input is TRUE). - Set Direction to 1 (positive) and apply the jog input. Watch the AQ output value in the online watch table; the voltage should ramp up smoothly, not jump.
- Watch the actual position in the online watch table. The position should change proportionally to the commanded velocity and reach the software limit switches without overshoot.
-
Reverse polarity test by setting
Direction= 0. If the cylinder extends in both directions or retracts when commanded to extend, invert the encoder polarity in the TO configuration. -
Enable position control in the TO and repeat the jog. If a positioning alarm appears, read the
ErrorWord, decode the active bit, and address the underlying cause. -
Issue
MC_Resetto clear the alarm, then re-arm the axis and resume jogging.
Cam Characteristic Learning
After open-loop motion is confirmed, the SIMA Hydraulics library expects a learned or imported cam table that maps the desired setpoint to the actual valve command at 5 to 11 points along the stroke. The learning procedure is:
- Call
LSimaHydTO_MC_LearnCharacteristicin manual mode. The FB will drive the valve through the configured setpoint points and record the actual cylinder response. - Store the resulting cam table in the data block assigned to the axis.
- Call
LSimaHydTO_MC_SetCharacteristicat the next startup so the controller uses the learned curve. - Repeat the
MC_MoveJogtest and verify the position error is within the target window.
If the learning run is skipped and the controller is left to assume a linear curve, the axis will exhibit a steady-state offset on one side of the cylinder and overshoot on the other. The closed-loop integral action eventually saturates the integrator, and the axis trips a Following error alarm that surfaces in the ErrorWord as a runtime or positioning error.
Open-Loop Verification and Troubleshooting Matrix
To confirm whether the fault is in the closed-loop controller or in the mechanics/sensor chain, disable the position controller and re-run MC_MoveJog. The cylinder should move at a constant velocity proportional to the jog setpoint, with no positioning alarm.
Open-loop success indicates:
- Mechanics and encoder are correct.
- Sensor is delivering valid position values.
- AQ output is wired correctly and the valve is responding.
Closed-loop success with the same setpoint then indicates the controller is now active. If the closed loop oscillates or alarms, the gain settings, dynamic limits, or the cam characteristic are wrong.
Troubleshooting matrix
| Symptom | ErrorWord group | Likely cause | Action |
|---|---|---|---|
Positioning alarm on first MC_MoveJog after MC_Power
|
Configuration | Encoder type or data block not consistent | Recompile the TO; check encoder type matches sensor |
| Alarm during direction reversal | Runtime | Position limits exceeded or SSI frame error | Reduce velocity; check SSI cable shielding and baud |
| Alarm only when position control is enabled | Positioning | Cam characteristic not loaded, integrator saturated | Run LearnCharacteristic; check Kv gain |
| Axis oscillates at target position | Positioning |
Kv gain too high |
Reduce Kv in TO Configuration > Control loop |
| Axis drifts after reaching target | Positioning | Valve dead zone not compensated | Recalibrate cam characteristic around zero crossing |
| Axis moves wrong direction on jog | Configuration | Polarity reversed in TO | Reverse encoder direction in TO Configuration |
| Axis moves only one direction | Runtime | Software limit switch or hardware limit reached | Check software limits and hardware limit switches |
| AQ output saturates immediately | Runtime | Sensor signal out of range or sensor disconnected | Verify AI range, sensor wiring, and SSI frame bits |
| Position drifts on every jog | Positioning | Mechanical hysteresis exceeds cam resolution | Increase number of cam points; re-learn |
Verification, Acceptance, and Safety
Once the positioning alarm is cleared, perform the following acceptance test before releasing the axis to production:
- Cycle the axis 50 times in jog mode without an alarm. The
ErrorWordmust remain 0 throughout. - Command 10 absolute moves of varying length and verify the position is reached within the configured positioning window (typically 0.1 mm for hydraulic cylinders).
- Command a step response and verify the settling time is within the process requirement.
- Capture the AQ output and the actual position on a trend; the AQ should not oscillate around the steady state, and the position should converge smoothly.
- Power-cycle the CPU and confirm the cam characteristic and axis parameters are restored from the remanent data blocks.
- Document the final parameters in the project documentation, including the cam table, the
Kvgain, the velocity and acceleration limits, and the encoder configuration.
MC_Power.Enable is FALSE or when the TO enters an error state; verify this in the safety acceptance test. Wire the valve driver so a CPU stop or PROFIsafe shutdown removes power from the valve solenoids, not just reduces the setpoint.FAQ
What does a non-zero ErrorWord mean on a S7-1500 positioning axis?
A non-zero <TO>.ErrorWord indicates that at least one technology alarm is active for that axis. The bit position identifies the alarm group (configuration, user, runtime, positioning). Read the TIA Portal V20 ErrorWord documentation for the exact bit mapping of your firmware version.
Why does MC_MoveJog generate a positioning fault only when the position controller is enabled?
With the position controller disabled, the axis follows the setpoint in open loop and the controller has no following-error detection. When the controller is enabled, the closed loop compares the actual position to the setpoint, and a saturated integrator or an unconfigured valve characteristic causes a persistent following error that trips the alarm.
How do I configure a Temposonics magnetostrictive sensor on TO_PositioningAxis?
Set the TO encoder type to Absolute encoder (SSI) for an SSI output, or to Analog measuring encoder for a 0-10 V / 4-20 mA output. Set the data length to 24 or 25 bits, the code type to gray or binary per the sensor datasheet, and the distance per revolution to the cylinder stroke length in millimetres.
Why is LSimaHydTO_MC_SetCharacteristic required before LSimaHydTO_HydAxisCall?
The controller assumes a linear valve curve unless a cam table is loaded by LSimaHydTO_MC_SetCharacteristic. Without the table, the closed loop cannot compensate for the valve dead zone, hysteresis, and nonlinear flow, and the axis will trip a positioning alarm during dynamic moves.
Where can I find the SIMA Hydraulics example project for S7-1500?
The example project is published on the Siemens support site: SIMA Hydraulics application example (MC_PreServo). The library documentation is at Library LSimaHydTO.