Siemens V90 EPOS Position Direction Reversal via P1821

David Krause12 min read
Motion ControlSiemensTroubleshooting
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

Problem Overview

A common commissioning symptom on the Siemens SINAMICS V90 servo drive is a mismatch between the commanded mechanical direction and the position counter polarity in EPOS (Basic Positioner) mode. The motor shaft rotates in the correct (positive) direction, the speed setpoint matches the actual speed, no drive alarm is raised, yet the position actual value r2521 decrements when the axis should be incrementing. When the same hardware family and Telegram configuration is used on a machine with three or more identical axes, the fault typically isolates to a single drive where the encoder zero pulse sits on the opposite side of the sine/cosine window, or the encoder was wired in a way that the drive's internal direction detection latched to "negative".

This article documents the field-proven method to reverse the position counting direction of a V90 with a 2500 ppr TTL incremental encoder without rewiring the motor phases, without swapping the encoder cable, and without inverting the setpoint in the PLC application. The recommended path is to write parameter p1821 (direction of rotation reversal) from the S7-1500 controller through SinaPos or SinaPara, since V-Assistant does not expose p1821, p0410, or p29030 in its standard view.

Affected Hardware and Firmware

Component Variant / Parameter Notes
Drive SINAMICS V90 (6SL3210-5FE... Firmware V1.04 and later recommended for full SinaPos axis control
Encoder Incremental TTL 2500 ppr AB-track, Z0 index, differential RS422
Control mode EPOS (Basic Positioner) Closed-loop position with internal interpolator
Controller SIMATIC S7-1511 CPU Any S7-1500 with PROFINET IRT capable port
Telegram Telegram 111 (EPOS) or 7 (extended) Telegram 111 is mandatory for SinaPos
Library SINAMICS V90 Lib V1.x (SinaPos FB285 / SinaPara FB286) Available in TIA Portal under "Libraries / SINAMICS"

Why V-Assistant Hides the Solution

The V90 commissioning tool V-Assistant exposes only the simplified parameter set (the p290xx range) that maps onto the SINAMICS V90 user interface. The following BICO-style and encoder parameters exist on the drive firmware but are intentionally hidden from V-Assistant to prevent novice users from corrupting the closed-loop structure:

  • p0410[0] – Encoder inversion (rotates the encoder evaluation; affects position counter)
  • p1821 – Direction of rotation reversal (rotates the sign of speed and position actual values)
  • p29030 – Selection of direction of rotation reversal (the V90-specific alias of p1821, but with limited range)

Of these, p1821 is the parameter that the S7-1500 / SinaPos environment writes when you toggle the "Positive" / "Negative" input at the function block. This is the only sanctioned method to invert the sign convention inside the drive while leaving the motor phases and the encoder cable untouched.

Step-by-Step: Reverse Position Direction on a Single V90 Axis

Step 1 – Verify Mechanical Wiring First

  1. Set p29001 = 0 (default direction of rotation) on the affected drive.
  2. Using the BOP (Basic Operator Panel) on the V90, navigate to the jog screen and command a slow positive setpoint.
  3. Observe the motor shaft from the flange (load side) – clockwise (CW) rotation must correspond to a positive speed setpoint. If CW corresponds to negative speed, the motor phases or encoder A/B assignment are reversed mechanically, and the wiring must be corrected before continuing. The rest of this procedure assumes CW = positive speed.
  4. Switch the drive to "Position control loop" via the control panel (use the V-Assistant control panel, NOT the BOP jog, since the BOP jog is open-loop and does not exercise EPOS).
  5. Command a small positive relative jog and observe the position actual value. In V-Assistant, monitor r2521 (actual position value, LU) and r2556 (position setpoint, LU). If both increment with CW rotation, the drive is correctly configured and the problem is at the PLC application level (skip to Step 5). If r2521 decrements with CW rotation, the position counter polarity is reversed and Step 2 must be applied.

Step 2 – Write p1821 = 1 from SinaPara (Direct Method)

SinaPara (FB286) is the low-level parameter access block. It does not need a configured axis; it simply reads or writes a single parameter index over the cyclic PROFIdrive channel or via the acyclic DP-V1 slot. Use this method when the application must persist the direction reversal across power cycles and you want the drive itself to remember the sign.

Drop LAcycCom (PROFINET name) and the SinaPara instance into a separate OB (for example OB1 cyclic at low priority) and call it as follows:

// TIA Portal - Structured Text (SCL) example
// SinaPara DB: drives[affectedAxis]
#drives[1].AxisNo      := 1;            // logical drive number
#drives[1].ParameterNo := 1821;         // p1821
#drives[1].SubIndex    := 0;            // no subindex
#drives[1].WriteRead   := TRUE;         // write mode
#drives[1].ReqValue    := 1;            // 0 = no reversal, 1 = reversal
#drives[1].Execute     := TRUE;

// wait for Done or Error
IF #drives[1].Done THEN
    // p1821 accepted
    #drives[1].Execute := FALSE;
END_IF;
IF #drives[1].Error THEN
    // inspect Status / ErrorID for drive-side reject
    #drives[1].Execute := FALSE;
END_IF;

Resulting drive-side state: p1821 = 1. The drive inverts the sign of r0061 (speed actual), r2521 (position actual), and the internal setpoint/actual evaluation used by EPOS. The change is volatile until saved with p0971 = 1 on the drive (or by pressing the SAVE button on the BOP for V90 firmware < 1.05). If the drive loses power and reloads factory defaults, the change is lost.

Step 3 – Persist the Change

Trigger the RAM-to-ROM copy so that p1821 survives power cycle. Use SinaPara with ParameterNo = 971, ReqValue = 1, WriteRead = TRUE. Do not write p971 while the drive is in motion, while traversing to a position, or while EPOS is active. The save operation takes 3 – 8 seconds. Read p0971 afterwards to confirm r0971 = 0 which means "save completed".

Warning: p1821 is a closed-loop safety parameter. When p1821 = 1, the drive also inverts the sign used by the controller's speed setpoint. If your S7 application was previously written assuming the broken polarity, you must NOT also invert the setpoint on the PLC side – that would create a double inversion and a runaway command. Reverse exactly one layer (drive OR PLC), never both.

Step 4 – Alternative: Toggle the SinaPos "Positive" / "Negative" Inputs

SinaPos (FB285) exposes two Boolean inputs that map to p1821 internally. Wiring them is the preferred way when the application already uses SinaPos and a runtime selector is required (for example, a HMI button to swap direction for mirror-image axes on a gantry). The relevant block inputs are:

SinaPos Input Direction Drive Parameter Description
JogPositive Positive direction jog — Manual jog in positive direction while in jog mode
JogNegative Negative direction jog — Manual jog in negative direction while in jog mode
Positive — p1821 = 0 Logic for positive direction (default)
Negative — p1821 = 1 Switches drive-side direction of rotation reversal

Toggling the Positive / Negative input at SinaPos issues a SinaPara-equivalent write to p1821. Therefore the same persistence (p971) step applies if the change must survive a power cycle.

Step 5 – Verify

  1. Power cycle the drive (or pulse OFF/ON at the 24 V control) so the new p1821 is loaded into the active parameter set.
  2. In V-Assistant, switch to the control panel. Select "Position control" and "Jog in positive direction".
  3. Command a small relative positioning motion. Monitor r2521 – the LU value must increment.
  4. From the PLC, perform a relative positioning of 1000 LU using SinaPos ModePos = 2 (relative positioning with setpoint set). Confirm that the actual position is +1000 LU at standstill, with no F07491 (drive: speed controller output limited), no F07492 (drive: position controller output limited), and no following error F07451.

Parameter Reference

Parameter Name Range Default Effect on Position
p1821 Direction of rotation reversal 0 / 1 0 Inverts sign of speed and position actual values in closed-loop operation
p0410[0] Encoder inversion (of encoder signal) 0 / 1 0 Rotates the encoder A/B evaluation; equivalent effect to p1821 for position
p29001 Selection of direction of rotation (V90 alias) 0 / 1 0 Only changes motor torque sign in open-loop test; does NOT fix position counter
p29030 Direction of rotation reversal (V90 alias) 0 / 1 0 V90 user-friendly version of p1821; same effect when accessed
r2521[0] Actual position value (LU) — — Read-back for verification
r2556[0] Position setpoint (LU) — — Read-back for verification
p2525 LR encoder assignment 0/1/2/3/4/5/6 1 Confirms which encoder is used for position
p29240 Position setpoint inversion (V90) 0 / 1 0 Inverts the setpoint only; actual value unchanged – use only for screen mirroring

Drive-Side Error Codes When Writing p1821

The following fault / alarm codes are commonly returned if the write is issued under the wrong drive state. SinaPara surfaces them as ErrorID and Status at the FB output.

Fault Meaning Resolution
F01000 Software / parameter error Stop EPOS motion, deselect ON/OFF1, retry
F01001 Floating point exception Verify SubIndex (0 for p1821, not 1)
F01002 Write-protected parameter Check p0001 access level; restore commissioning access
A01999 Parameter write during operation rejected Disable ramp-function generator, halt axis, retry
F07451 Following error Verify encoder direction after p1821 change; tune Kv (p29120)
F7452 Standstill monitoring tripped Lower p2542 or p2546 if direction change temporarily moves the axis

Troubleshooting Matrix

Symptom Likely Cause Action
Speed setpoint positive, motor rotates negative Motor phases A/B/C inverted, or encoder A and B swapped Fix wiring; do not use p1821 to mask
Speed correct, r2521 counts negative Encoder A/B evaluation inverted Set p1821 = 1, save with p971
Position correct, setpoint shows negative in trace MDI direction flag set to 2 or 3 in motion block Set MDI direction to 1 (positive)
r2521 freezes at 0 with incremental moves Referencing active (active homing in progress) Wait for homing to complete; check r2684.0 (homing active)
Position jumps by full revolution on each start Modulo configuration with wrong range Verify p29245 modulo range and p2576 modulo correction
p1821 write returns ErrorID = 0x7001 SinaPara still busy from previous call Wait for Done or Aborted before re-triggering Execute
Direction reverses on every power cycle p1821 written but not saved Write p971 = 1 after p1821
F01900 after p1821 write Saved parameter checksum mismatch Power cycle; the drive recalculates on next boot

Edge Cases and Field Notes

Reference / Homing Interference

Do not change p1821 while the drive is in "Active referencing" state (r2684.0 = 1). The encoder is captured during the reference cam; if p1821 changes between two referencing operations, the absolute offset stored in p2599 is invalidated and the axis will start from a random mechanical position on the next referencing. Always complete the homing, then change p1821, then re-reference.

Modulo Axes

For modulo axes (rotary tables, tool turrets) with p29245 = 360000 LU/revolution, p1821 = 1 inverts the modulo direction. The drive still rolls over correctly; only the sign convention changes. Verify that your PLC application uses the same modulo convention.

Spindle Synchronism

If the affected V90 is part of a synchronized group (SinaPos with "FollowingAxis" mode or a cam from SIMOTION), changing p1821 on one axis will desynchronize the group. Re-establish coupling and re-synchronize after the change.

Brake Control

Setting p1821 = 1 inverts the holding brake release direction. If the axis uses an internal holding brake (p1215 = 3 or 4), confirm that the brake still opens at the correct state; otherwise the brake may chatter. Use p1216 (brake release time) and p1217 (brake closing time) to debounce.

Alternative Methods (Not Recommended for This Use Case)

  1. Invert the encoder A and B traces in the cable. This is mechanically equivalent to p1821 = 1 but requires physical intervention. Acceptable on a single cabinet; not acceptable when the encoder cable is shared with a downstream safety encoder or routed through a field junction box.
  2. Swap two motor phases (U and V). This swaps the torque direction, not the encoder direction. It does not fix r2521.
  3. Apply a "−1" multiplier in the PLC on every setpoint and actual value. This is the worst option: it propagates the sign error into the HMI, the trace, the cam, and the PLC arithmetic. It is forbidden in safety-relevant applications because the HMI display no longer matches the actual machine geometry.

Commissioning Checklist After p1821 Change

  • [ ] Encoder pulses in CW direction (r0061 positive) verified with trace in V-Assistant
  • [ ] r2521 increments in CW direction verified with trace in V-Assistant
  • [ ] SinaPos absolute encoder adjustment (homing) re-executed
  • [ ] Position controller Kv (p29120) checked; re-tune if needed
  • [ ] Following-error window (p2544) checked
  • [ ] Standstill window (p2542) checked
  • [ ] Brake timing (p1216 / p1217) checked
  • [ ] Drive alarm buffer cleared (p0952 = 0)
  • [ ] Drive state machine reflects S1 (run) and ZSW1.2 (ready) on HMI
Cross-Reference: The V90 PTI (pulse train) variant follows the same p1821 rule. The V90 PN (PROFINET) variant used in this article uses Telegram 111 with SinaPos; the V90 PTI version uses external pulses and is typically configured with p29001 in V-Assistant because the V-Assistant mask is wider for the PTI firmware. Always confirm your variant by reading the rating label or r01000 in V-Assistant.

FAQ

Why does V-Assistant not show p1821 or p0410?

V-Assistant only displays the simplified p290xx user-level parameter set for safety and to avoid corrupting the closed-loop structure. The underlying SINAMICS parameter p1821 is accessible via SinaPara (FB286) or by writing through SinaPos. The same applies to p0410 (encoder inversion) and most BICO parameters.

I changed p1821 to 1 but the direction reverses on every power cycle. Why?

The change is volatile until you save it to ROM. Trigger a save with SinaPara writing p971 = 1, wait 3 to 8 seconds until p971 is back to 0, then power cycle. Without the save, the drive reloads the last saved value (default 0) on each cold start.

Can I use p1821 = 1 together with an inverted setpoint in the PLC?

No. That creates a double inversion and the drive will interpret the wrong direction, leading to F07451 (following error) or runaway motion. Reverse the sign in exactly one layer: either inside the drive (p1821 = 1) or inside the PLC application (multiply the setpoint and actual value by -1). Drive-side reversal is preferred for traceability.

What is the difference between p1821 and p29240 on the V90?

p1821 reverses the sign of both setpoint and actual value at the drive internal level (the closed-loop sign). p29240 only inverts the position setpoint evaluation for screen mirroring; the actual value stays unchanged. Use p1821, not p29240, for mechanical direction reversal.

Does p1821 = 1 affect the V90 in open-loop test mode (V-Assistant control panel jog)?

Yes. p1821 also inverts the speed actual value r0061 in speed-control mode, so the V-Assistant control panel will report a negative speed when the motor rotates CW. The motor shaft still rotates in the correct mechanical direction, but the sign on the display is flipped. This is the correct behavior and is why the BOP jog (open-loop test, p29001) does not match the closed-loop speed display.

Will p1821 = 1 work on the V90 PTI variant?

Yes. The same parameter p1821 exists on both V90 PN and V90 PTI. The V90 PTI variant simply uses Telegram 7 or 9 instead of Telegram 111 because EPOS is executed externally, but p1821 still inverts the encoder evaluation.

What happens to p2599 (homing offset) when p1821 is changed?

p2599 is not automatically updated. The absolute reference established during homing uses the sign convention of the moment of homing. If you change p1821 after homing, the absolute reference becomes invalid; the actual position will be offset by the machine position at the time of p1821 change. Re-execute homing after every p1821 change.

Back to blog