SIMOTION Absolute Encoder: Fix Axis Modulo Range 0-360 vs -180 to 180
1. Problem Overview
When commissioning a SIMOTION application using a 1FK7 series servo motor with an absolute encoder, the axis command MCC (Motion Control Chart)_pos() is issued to a target position of 90° (or -90°), but the drive does not stop at the target. The motor continues rotating until the controller is placed into stop / fault or a hardware stop is reached. Once rotation behavior is corrected, the feedback value reported at axisName.basicmotion.position is 270° when commanding -90°, indicating that the technology object (TO) is treating the axis as a linear, non-modulo range of 0–360° rather than the desired ±180° symmetry expected for a rotary table.
This condition typically arises when:
- The Axis TO is created as Linear instead of Rotary (Modulo).
- The Modulo range defaults to
0 .. 360°, while the application logic assumes a signed range of-180 .. 180°. - The absolute encoder reference is correct mechanically, but the SIMOTION
actual positionreports an unwrapped value that does not represent the mechanical position around a single revolution.
Outcome: Continuous rotation past target position and a position feedback value that does not match the commanded mechanical angle.
2. Affected Components and Firmware
| Component | Order Number / Designation | Notes |
|---|---|---|
| Servo motor | 1FK7022-5AK71-1LG0 | SIMOTICS S-1FK7 compact servo, 22-frame, with absolute encoder |
| Encoder | AM20DQI (built-in, single-turn 20-bit + multi-turn 12-bit) | DRIVE-CLiQ interface, 4,096 × 4,096 increments per revolution |
| Controller | SIMOTION D4x5 / C240 / P320 (any current SIMOTION) | Tool: SIMOTION SCOUT / SCOUT TIA V5.x |
| Firmware | SIMOTION V4.4 / V4.5 / V5.1 / V5.2 (SCOUT) | Axis TO concept unchanged across these versions |
| Drive | SINAMICS S120 (CU320-2 / CU310-2) | DO list v4.x / v5.x with 1FK7 motor module |
The 5AK71-1LG0 suffix in the order number identifies the motor as equipped with the multi-turn absolute encoder (suffix 5A) and integrated DRIVE-CLiQ (no resolver option required for the drive-side identification).
3. Root Cause Analysis
The mechanical absolute encoder on a 1FK7022 reports a unique value for every mechanical angle across the full mechanical range, but it does not define how the controller software treats that range. The interpretation of the angle is a property of the SIMOTION Axis TO, specifically the combination of:
- Axis type – Linear vs. Rotary (Modulo).
- Modulo range – For Rotary axes, the lower and upper modulo limits (default 0° and 360°).
- Encoder reference / homing – Defines where the software's zero lies relative to the encoder's hardware zero.
When the Axis TO is created as Linear with default units in degrees, SIMOTION sees the motor as a linear axis whose position can grow without bound. A target of 90° is treated as the absolute value 90° from the software zero, and a target of -90° is treated as -90° from the software zero. After enough rotations, the internal counter keeps climbing, and the actual position tag reflects this unwrapped value. Because the drive never sees a positional match, it does not stop at the target; the position controller continues to drive toward the moving virtual target.
Conversely, on a properly configured Modulo axis with range -180° .. 180°, commanding -90° is interpreted as the same mechanical position as +270° but is reported as -90°, which is the convention the application code expects. The position controller then drives to a position that, modulo 360°, matches the target, and the motor stops.
...driveState.actualSpeed or ...basicmotion.actualPosition in the control panel; if the value does not change in the expected direction, the encoder hardware or DRIVE-CLiQ wiring is the primary suspect.
4. Step-by-Step Solution
4.1 Verify the Encoder Reports Position Correctly
- Open SIMOTION SCOUT and connect to the target device.
- Open the Axis control panel from the Axis TO context menu (Control Panel).
- Set master / drive enable, then Jog the motor a few revolutions by hand or at very low speed.
- Watch the field
actPos– it should increment and decrement in degrees. The total change after one mechanical revolution must equal 360° (within one encoder increment). For the 1FK7022-5AK71, one revolution = 16,777,216 increments (24-bit), i.e. one increment ≈ 2.1467e-5°.
If the displayed value does not change, the absolute encoder / DRIVE-CLiQ link is at fault. Check the SINAMICS topology, wiring, and that the motor order number has been correctly entered in the SINAMICS DO list (motor record).
4.2 Change the Axis TO to Rotary (Modulo)
- In the project navigator, right-click the Axis TO (e.g.
Axis1) and choose Properties. - Navigate to Configuration > Mechanics (or Mechanics tab depending on SCOUT version).
- Set Type of axis to Rotary axis (with modulo).
- Under Modulo range enter:
-
Lower modulo limit:
-180.0 -
Upper modulo limit:
+180.0
-
Lower modulo limit:
- Choose the desired Modulo length – this is the result of the upper minus the lower limit and is shown as 360° by default. Confirm the value reads
360°. - Click OK and download the project to the target (SCOUT > Target system > Download).
4.3 Configure Units and Increments per Revolution
Inside the same Axis TO dialog, confirm:
- Position unit: ° (degrees)
- Increments per revolution: populated automatically from the encoder configuration (16,777,216 for the AM20DQI absolute encoder on 1FK7).
- Gear ratio: 1:1 unless the machine has an external gearbox – if so, enter the ratio so the load-side degrees are correct.
4.4 Program the MCC for a Modulo Move
For a modulo axis, the MCC chart must use commands that understand the modulo range. Use the standard _pos() (position absolute) command, which on a modulo axis automatically takes the shortest path to the target when shortestPath = YES is set. Example chart snippet:
// MCC chart example: drive to -90° on a modulo axis
// Trigger: chart is called once per cycle
Axis1.basicmotion.enable := TRUE;
Axis1.basicmotion.position := -90.0; // target [°]
// _pos command on a modulo axis interprets -90 as -90 within the
// configured modulo range, not as 270.
IF Axis1.basicmotion.motionState = IN_POSITION THEN
// motion complete - axis stopped at -90° mechanical
END_IF;
Inspect the parameters of the _pos command block:
| Parameter | Value | Meaning |
|---|---|---|
| Position | -90.0 | Target in [°] within the modulo range |
| Velocity | Application dependent | Profile velocity |
| Acceleration | Application dependent | Profile acceleration |
| Deceleration | Application dependent | Profile deceleration |
| Jerk | 0 (off) or app. value | Profile jerk (optional) |
| shortestPath | YES / NO | Modulo-only: take shortest path |
| positiveDirection | YES / NO | Modulo-only: force direction |
shortestPath = YES, the SIMOTION runtime computes the optimum travel direction. When the user wants a specific direction, set positiveDirection or negativeDirection explicitly, and set shortestPath = NO.
4.5 Homing and Encoder Reference
An absolute encoder does not require an incremental homing run at every restart, but a reference must be established the first time the axis is commissioned. The control panel supports absolute encoder referencing without motion, see Homing with the axis control panel (S7-1500, S7-1500T) for the equivalent procedure on SINAMICS-Integrated / S7-1500T, which uses the same semantic.
- Open Axis > Control Panel > Homing.
- Select Absolute encoder adjustment (passive) if the axis is mechanically positioned at the reference mark.
- Enter the offset so the current mechanical angle matches the desired positioning value in the TO (e.g. 0° at top dead centre).
- Click Set – the
actual positionis now bound to the encoder.
5. Verification Procedure
After download and CPU restart, perform the following sequence to confirm the fix:
- Open the Axis control panel. Enable the drive.
- Jog to 0°, jog to 90°, jog to 180°, jog to -90° using the control panel. Each jog must stop at the target with status In position.
- Read the actual value at
Axis1.basicmotion.actualPosition– it should report the actual mechanical angle in the range -180° .. 180°. - Run the MCC
_poscommand to -90°. The motor must rotate the shortest path (i.e. -90° rotation if the start is at 0°, not +270°). The reported actual value must be -90°. - Issue
_posto +90°. The motor must rotate +180° (or take the shortest path). The reported actual value must be +90°.
If the actual value still reads 270° after a commanded -90° movement, return to section 4.2 and re-check that the modulo range is set to -180° .. 180° and that the Axis TO is of type Rotary (with modulo).
6. Diagnostic Tags and WebHMI Watch
The following tags of the Axis TO are the primary diagnostic points to expose on the WebHMI / HMI for in-service monitoring:
| Tag | Description | Expected Range |
|---|---|---|
axisName.basicmotion.actualPosition |
Current actual position in configured unit | -180° .. 180° |
axisName.basicmotion.position |
Last commanded target | -180° .. 180° |
axisName.motionStateData.motionCommand |
Currently active motion command ID | Numeric |
axisName.motionStateData.motionState |
Motion state (e.g. ACCELERATING, CONSTANT_VEL, IN_POSITION, STOPPED, ERROR) | Enum |
axisName.diagnostic.error |
Axis error bits | Bit field |
axisName.sensorModule[1].absoluteEncoderValue |
Raw absolute encoder value | 0 .. 16777215 |
7. Common Pitfalls and Field Tips
7.1 Modulo Axis Created but the Default Range is 0 .. 360
Switching the axis type to Rotary does not change the default modulo range; SIMOTION keeps the value you configured during the Axis wizard. Always re-enter the modulo range to match the application convention.
7.2 Inconsistent Unit Between TO and Program
If the axis unit was originally set to mm or rev, simply switching the axis to rotary leaves the unit untouched. Confirm the unit in the Axis TO is ° and that the MCC / ST program writes its target values in the same unit. Mixing units (writing a value that the program treats as mm into a TO configured in °) produces the exact symptom described in the source – a motor that spins past the target by a factor equal to the unit ratio.
7.3 Position Setpoint Filter and Cyclic Override
The MCC _pos command is interrupted if the cyclic application overwrites the target before the axis reaches IN_POSITION. Check the Transition behaviour of the chart, the Delay program execution parameter, and ensure the chart is run to completion in a single execution (sequential / step-by-step). Continuous re-triggering of the chart on a still-rotating axis causes the next target to overwrite the in-flight one and the axis to chase an ever-changing virtual setpoint.
7.4 Power-Off / On With Absolute Encoder
After a power cycle, the absolute encoder retains its position. The TO must re-accept the encoder value during ramp-up; this is automatic if the axis configuration contains the correct encoder. If the actual value jumps by a full revolution after power-up, the encoder zero offset in the TO has been lost – repeat the homing procedure in section 4.5.
7.5 SINAMICS Drive-Side Direction Reversal
If the drive direction in the SINAMICS DO list is reversed relative to the mechanical expectation, the actual value still increments in the same numerical direction (i.e. encoder sign) but the mechanical rotation is reversed. The fix is on the drive side (invert p410 or p1820) – not in SIMOTION. This is not the cause of the modulo-range issue but is often confused with it.
8. Quick Reference Checklist
- ☐ Axis TO type = Rotary (with modulo)
- ☐ Modulo range =
-180° .. 180°(or the application-specific range) - ☐ Position unit = °
- ☐ Increments per revolution = 16,777,216 for AM20DQI on 1FK7
- ☐ Gear ratio = 1:1 (or correct value for external gearbox)
- ☐ Drive enable applied
- ☐ Absolute encoder referenced once after commissioning
- ☐ MCC
_poscommand with correctshortestPath/positiveDirectionflag - ☐ Control panel jog to ±90° and 180° succeeds and reports correct actual position
9. Related Concept: Modulo on SINAMICS Integrated / S7-1500T
The same convention applies to S7-1500 / S7-1500T technology objects. According to the official TIA Portal documentation Homing with the axis control panel (S7-1500, S7-1500T), homing establishes the relationship between the technology object position and the mechanical position. The modulo range is configured in the technology object dialog under Mechanics and works identically across SIMOTION and the S7-1500T platform. Engineers migrating from SIMOTION to S7-1500T can re-use the same -180° .. 180° convention without code changes other than the API call syntax.
10. FAQ
Why does my SIMOTION 1FK7022 axis not stop at 90° even though the absolute encoder reads correctly when turned by hand?
The most likely cause is that the Axis TO is configured as Linear with units in degrees, so the runtime treats 90° as an unwrapped absolute target. Open the Axis TO properties, change Type of axis to Rotary (with modulo), set the modulo range to -180° .. 180°, and re-download. The position controller will then wrap the target and stop at the commanded mechanical angle.
Commanded -90° but actualPosition reports 270° – how do I get a signed range?
Configure the Axis TO with the modulo range -180° .. 180° (instead of the default 0° .. 360°). The actualPosition tag will then reflect the same convention as the command, so a target of -90° reports -90°, not 270°.
Do I have to home the absolute encoder on a 1FK7022-5AK71-1LG0 every time the controller powers up?
No. The 1FK7 with absolute encoder (suffix 5A) keeps its position across power cycles. You only need to perform the absolute adjustment once during initial commissioning, and after that the technology object re-accepts the absolute value automatically on ramp-up.
How many increments per revolution does the 1FK7022-5AK71 absolute encoder provide?
The AM20DQI absolute encoder on the 1FK7022-5AK71 is a 20-bit single-turn + 12-bit multi-turn device, giving 4,096 × 4,096 = 16,777,216 increments per revolution. This value is auto-loaded into the Axis TO when the motor is selected in the SINAMICS DO list.
What is the difference between shortestPath and positiveDirection on a modulo axis MCC command?
shortestPath = YES lets the runtime pick the direction with the least travel. positiveDirection (or negativeDirection) forces a direction. Use shortestPath = NO together with the explicit direction flag if the application must always rotate the same way (e.g. to avoid cable wrap on a cable carrier).