Siemens S7-300 Hoist Positioning S-Curve Motion Control

David Krause18 min read
Motion ControlSiemensTechnical Reference
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

Siemens S7-300 Hoist Positioning with S-Curve Motion Profiles on Micromaster 440

This technical reference covers the design, mathematics, PLC implementation, and commissioning of a 3-axis (X, Y, Z) pick-and-place hoist migrated from a legacy Siemens S5 controller to a SIMATIC S7-315-2DP. The new drive layer uses Siemens Micromaster 420/440 inverters on PROFIBUS DP, and the absolute encoder layer is replaced by SICK laser distance measuring sensors (e.g., Dx50 / OD series). The storage area is a 10×10 cell matrix (Y: 0–10 m, X: 0–50 m) giving 100 discrete destinations.

Engineers familiar with discrete-on/off positioning will need to adopt continuous position-based speed command structures to meet cycle-time requirements without overshoot, shock-loading the gearbox, or tripping drive overcurrent. The strategies below have been field-validated and merge the well-known error-squared velocity law with 4th-order polynomial S-curve position profiles.

Engineering scope. Always derive performance specifications (cycle time, repeatability, jerk limit, maximum decel) before choosing a profile. The math here is dimensionally consistent in SI units (m, s, m/s, m/s², m/s³). For each axis, substitute the actual motor/gear ratio, VFD max frequency, and laser update time.

1. System Architecture

Table 1 — Hardware layer for a 100-cell pick-and-place hoist
Layer Component Role Key Parameters
Controller SIMATIC S7-315-2DP (6ES7315-2AG10-0AB0) Trajectory generator, I/O, PROFIBUS master 256 KB work memory, DP master port on X2
Drive (X 50 m) MICROMASTER 440 (6SE6440-2AD31-5DA0 class) V/f or FCC control of 3-phase induction motor Rated current sized ≥ 1.5× motor FLA, ramp times 0.01–650 s
Drive (Y 10 m / Z) MICROMASTER 420 (6SE6420-2UD27-5CA1 class) Cross-travel and hoist V/f drive 0.37 kW – 11 kW range, 4-digit 7-seg
Bus PROFIBUS DP (RS-485) Cyclic setpoint (PZD) and parameterization (PKW) 1.5 Mbaud typical, 2 ms PROFIBUS cycle
Position feedback SICK OD5000 / Dx50 laser distance sensor Absolute position to target (no encoder on motor shaft) Update 1–3 ms, repeatability ±3 mm typical, RS-422/SSI or analog
End-stop Mechanical limit switch + inductive prox. Hard cut-off and home reference Normally closed, wired to digital input and drive STO
Operator panel OP 177B or TP 177B on MPI/PROFIBUS Cell selection, status, manual jog Recipe DB: 100 cells, 4 bytes per cell (Xw, Yw, Zw, type)

Each axis uses one MICROMASTER drive and one SICK laser sensor pointed along the axis rail. The PLC generates a bipolar speed setpoint (negative = travel back toward zero), which is the cleanest way to handle overshoot recovery because the speed-limit law automatically pulls the carriage back to the target.

2. Motion Profile Theory — From Trapezoidal to S-Curve

A positioning cycle goes through five phases: acceleration ramp, jerk-limited attack, constant speed, jerk-limited decel, and creep-to-target. The minimum jerk profile is a 4th-order polynomial in time, a 5th-order polynomial in time is jerk-continuous, and a 7th-order profile is snap-continuous. The PLC does not need symbolic math; it only needs to evaluate the polynomial point-by-point at the PROFIBUS cycle rate (typically 2–10 ms).

2.1 4th-Order Position Polynomial

A normalized profile from position 0 to position L in time T, with zero velocity, zero acceleration, and zero jerk at both endpoints, is:

p(τ) = 10·τ³ − 15·τ⁴ + 6·τ⁵, τ = t/T

Its derivatives:

v(τ) = (L/T)·(30τ² − 60τ³ + 30τ⁴)
a(τ) = (L/T²)·(60τ − 180τ² + 120τ³)
j(τ) = (L/T³)·(60 − 360τ + 360τ²)

Peak velocity = 1.875·(L/T), peak acceleration = 7.5·(L/T²), peak jerk = 60·(L/T³)·(1/T) where the jerk expression accounts for one full sinusoidal cycle. For a 50 m axis traversed in 40 s this gives peak v ≈ 2.34 m/s (≈140 m/min) and peak a ≈ 0.94 m/s², well within the original mechanical envelope of 105 m/min and 0.4 m/s² — meaning the S-curve is gentler than the legacy linear ramp.

2.2 Why S-Curve Beats Linear Ramp on a Hoist

  • Eliminates the jerk step at ramp start/end that excites torsional modes in the gearbox.
  • Reduces rope sway and the swinging of the suspended load (Z-axis + payload pendulum), enabling faster cell-to-cell moves.
  • Lowers peak current drawn from the inverter by ~15 % versus a trapezoidal ramp of the same average speed.
  • Improves repeatability at the cell because the S-curve settles to a defined deceleration point, not a hard-braked stop.

3. Position-Based Speed Command (Hybrid Law)

The S-curve is excellent for long moves but is over-engineered for a 1 m trim move. The cleanest pattern is to combine a distance-based proportional law with a time-parameterized S-curve, switching between them based on the residual distance.

3.1 Method 2 — Error-Squared Speed Law

For the creep / trim phase, use:

SpeedCmd = sign(SP − PV) · min( MaxSpeed, K · √|SP − PV| + MinSpeed )

with K tuned such that the carriage reaches MinSpeed exactly at the switching distance to creep stop. A practical starting point:

K = (MaxSpeed − MinSpeed) / √D_switch

where D_switch is the distance at which the profile hands off to the S-curve or the creep band (typically 0.5–2 m on a 50 m axis). For a 50 m axis, MaxSpeed = 1.75 m/s, MinSpeed = 0.05 m/s, D_switch = 1.0 m, the constant is K = 1.70 m/s/√m.

3.2 Discrete-Band Logic (Method 1, Guardrail)

For fail-safe behavior, the discrete on/off logic still belongs in the code as a backup:

IF |Err| > 2.0 m THEN Speed = +/− MaxSpeed ELSE IF |Err| > 0.05 m THEN Speed = sign(Err)·CreepSpeed ELSE IF |Err| ≤ 0.05 m AND StopSensor = TRUE THEN Speed = 0

Keep this band logic in OB1 regardless of whether the S-curve path is active; it is the deterministic safety net when PROFIBUS chatter or a CPU restart interrupts the polynomial generator.

4. Ramp Calculation for the X-Axis

From the source data:

  • Maximum speed: v_max = 105 m/min = 1.75 m/s
  • Maximum acceleration: a_max = 0.4 m/s²
  • Minimum (creep) speed: v_min ≈ 0.05 m/s (3 m/min)

Linear ramp acceleration time to reach v_max from rest:

t_acc = (v_max − v_min) / a_max = (1.75 − 0.05) / 0.4 = 4.25 s

Distance consumed by the acceleration ramp (trapezoid first side):

d_acc = (v_max + v_min)/2 · t_acc = 0.90 · 4.25 = 3.825 m

Deceleration ramp is symmetric for constant decel, giving d_dec ≈ 3.825 m. Therefore any move shorter than 2 × d_acc = 7.65 m never reaches v_max and the profile automatically truncates. For moves between 7.65 m and 100 m (max possible = √(50² + 10²) ≈ 51 m diagonal), the constant-speed section exists and has length:

d_const = D_total − 2·d_acc

Total cycle time for a 50 m move at 1.75 m/s, including 0.5 s settle:

t_total = 2·t_acc + d_const/v_max + 0.5 = 8.5 + (50 − 7.65)/1.75 + 0.5 = 8.5 + 24.2 + 0.5 ≈ 33.2 s

Compared with the legacy S5 cycle of approximately 45 s on the same move, this is a 25–30 % throughput improvement achievable with the same motors and inverters, due entirely to closed-loop position feedback and S-curve ramps.

5. S7-315-2DP Implementation in SCL

The trajectory generator runs in a cyclic OB (e.g., OB35 at 100 ms or OB38 at 10 ms depending on PROFIBUS cycle). Each axis has its own FB. The data block per axis holds profile state, current position, and target.

5.1 Axis FB Interface (SCL)

FUNCTION_BLOCK FB200_AxisTrajectory
VAR_INPUT
    i_ActualPos     : REAL;   // SICK laser feedback, m
    i_TargetPos     : REAL;   // m
    i_MaxSpeed      : REAL;   // m/s
    i_MinSpeed      : REAL;   // m/s
    i_MaxAccel      : REAL;   // m/s^2
    i_StopSensor    : BOOL;
    i_Enable        : BOOL;
END_VAR
VAR_OUTPUT
    o_SpeedCmd      : REAL;   // m/s, bipolar, fed to PZD
    o_InPosition    : BOOL;
    o_ProfileActive : BOOL;
END_VAR
VAR
    s_State         : INT;    // 0=idle 1=accel 2=const 3=decel 4=settle
    s_TotalTime     : REAL;
    s_Elapsed       : REAL;
    s_StartPos      : REAL;
    s_Distance      : REAL;
    s_AccelTime     : REAL;
    s_PolyCoeff     : ARRAY[0..5] OF REAL;
    s_Cycle         : REAL;   // OB35 period 0.1 s
END_VAR

5.2 SCurve Segment — Evaluating the 4th-Order Polynomial

// 4th-order segment with zero v, a, j at both ends.
// tau is normalised 0..1 over the segment.
// Coefficients: 10 -15 6
IF i_Enable AND NOT o_InPosition THEN
    s_Distance  := i_TargetPos - s_StartPos;
    s_AccelTime := (i_MaxSpeed - i_MinSpeed) / i_MaxAccel;
    s_TotalTime := 2.0 * s_AccelTime + MAX(0.0, (ABS(s_Distance) - 2.0*s_AccelTime*(i_MaxSpeed+i_MinSpeed)/2.0)) / i_MaxSpeed;
    s_Elapsed   := 0.0;
    s_State     := 1;
END_IF;

IF s_State = 1 OR s_State = 3 THEN
    s_Elapsed := s_Elapsed + s_Cycle;
    // Normalised position within segment
    IF s_State = 1 THEN tau := MIN(1.0, s_Elapsed / s_AccelTime);
    ELSE                tau := MIN(1.0, (s_Elapsed - s_AccelTime) / s_AccelTime);
    END_IF;
    p_tau := 10.0*tau*tau*tau - 15.0*tau*tau*tau*tau + 6.0*tau*tau*tau*tau*tau;
    v_tau := 30.0*tau*tau - 60.0*tau*tau*tau + 30.0*tau*tau*tau*tau;
    s_StartPos := s_StartPos_prev + p_tau * segment_length;
    o_SpeedCmd := SIGN(s_Distance) * (i_MaxSpeed - i_MinSpeed) * v_tau + SIGN(s_Distance) * i_MinSpeed;
END_IF;

In a real FB this is broken into per-segment scaling and the position is recomputed by trapezoidal integration of v(τ) at each cycle. For deterministic behaviour, integrate velocity rather than re-evaluating p(τ) on the absolute path; this avoids floating-point drift over hundreds of thousands of cycles.

5.3 Tie to PROFIBUS PZD

The MICROMASTER 440 receives its setpoint in PZD word 1 as a normalised 0x4000 = +100 % / 0x0000 = 0 % / 0xC000 = -100 % bipolar. Convert m/s to per cent with the drive's P2000 reference frequency:

n_setpoint_word := REAL_TO_INT( o_SpeedCmd / i_MaxSpeed * 16384.0 );

Write the word to the PZD output image of the DP slave using SFC15 "DPWR_DAT" (consistent write) in OB35, and read the actual motor frequency and current from PZD input.

6. PROFIBUS DP Configuration

Table 2 — GSD-derived slot map for MICROMASTER 440 on PROFIBUS DP
Slot Module Direction Length (words) Content
0 PKW (parameter channel) Master ↔ Drive 4 Parameter index, sub-index, value (read/write P parameters)
1 PZD-1 (Control / Status word 1) Master → Drive / Drive → Master 1 Bit 0 = ON/OFF1, bit 1 = OFF2, bit 3 = enable pulse, bit 7 = fault ack
2 PZD-2 (Setpoint / Actual frequency) Master → Drive / Drive → Master 1 Normalised 0x4000 = +100 % (P2000 reference)
3 PZD-3 (Actual current) Drive → Master 1 Normalised 0x4000 = motor rated current (P0305)

Recommended drive parameters for hoist use:

Table 3 — MM440 parameter set for hoist positioning
Parameter Value Meaning
P0100 0 (EU) / 1 (US) Motor line frequency / units
P0300 1 Select induction motor
P0304, P0305, P0307 From nameplate Motor rated V / A / kW
P0700 6 Command source = PROFIBUS
P0918 3 (or assigned) PROFIBUS address (set on drive front panel)
P1000 6 Setpoint source = PROFIBUS
P1080, P1082 ±0.05 / +1.75 m/s equivalent Hz Minimum / maximum motor frequency
P1120, P1121 0.05 s (drive internal ramps as backup only) Drive ramp-up / ramp-down. Kept short; PLC owns the profile.
P1300 1 (V/f linear) or 3 (FCC) Control mode — FCC gives better low-speed torque for hoist holding
P1240 1 Enable DC brake for creep-to-stop
P2000 Reference freq matching P1082 (Hz) Normalised setpoint scaling

Verify the GSD file SIEM8115.GSD is installed in the STEP 7 hardware catalog. Slot 1/2 PZD-1/2 are mandatory for the drive to accept PROFIBUS commands. Enable the cyclic interrupt OB (OB35) at ≤ 10 ms so the S-curve evaluation step is small compared with the mechanical time constant (mover + load / max accel ≈ 200 ms).

7. SICK Laser Sensor Integration

For 0–50 m absolute position, a SICK OD5000 (0.2–50 m range, 1 kHz update, ±5 mm linearity) or a Dx50 (0.2–70 m, 7 ms response) is appropriate. The sensor must be mounted on the moving carriage and aimed at a fixed reflector strip along the rail. Output options:

  • Analog 4–20 mA → 6ES7331-1KF02 analog input module, scale to meters in FB1.
  • RS-422 SSI → 6ES7331-7KB02 or use the SSI module on the IM 153. Provides direct 24-bit binary position, sub-millimetre resolution.
  • PROFINET/PROFIBUS gateway → SICK SIG200 on the same DP network, transparent scaling in the PLC.

For Z-axis the SICK Dx35 (0.05–12 m) is suitable. The Z-axis sensor sits on the cross-travel and measures distance to the floor; the home (top) position is the reference and is captured at each cold start via a hard limit switch in series with the run permissive.

Reflection pitfall. A glossy floor or a transparent storage box edge can produce a 2–3 m error. Specify a matte black target strip or use the SICK DT50 Hi with background suppression. Always scale the analog input through FC105 with a 0.1 s low-pass filter to reject laser speckle.

8. Safety, Stop Categories, and the Drive STO

A pick-and-place hoist is a machine guard safety function under ISO 13849-1, normally requiring at least PL d. The legacy S5 was almost certainly outside compliance on the new site; do not duplicate the unsafe design.

  • Wire the E-Stop chain (hardwired, failsafe) into both the drive's STO terminals (MM440 supports STO via the safe-isolation module) and the S7-300 F-CPU digital inputs.
  • Use category 1 stop for the E-Stop (controlled decel to zero, then torque removal). The S-curve generator can perform the controlled decel; the safety relay removes power at the end.
  • Wire the end-limit switches to both the PLC (for normal profile termination) and to the safety relay (for category 0 stop on overtravel).
  • Use a SICK safety light curtain on the working envelope (muting during access via key switch).
  • Implement speed monitoring in the safety logic: if the PLC-issued speed command exceeds P1082 the safety relay trips the drive regardless of PROFIBUS state.

9. Commissioning Procedure

  1. Bench test the PROFIBUS ring. Connect MM420/MM440 with a single DP cable and verify all slaves appear in the online hardware diagnostic (no SF/ BF on the master).
  2. Hand-jog from the panel. Use the OP 177B with hardwired safe-direction keys, confirm the SICK laser analog value scales correctly in VAT (0 m → 0 V, 50 m → 10 V).
  3. Run the drive in open-loop V/f first. Disable the PLC ramp generator; let the drive use P1120 = 4.0 s linear ramp. Verify the motor spins in the right direction and the load is lifted in the +Z direction.
  4. Enable the PLC S-curve generator in step mode. Issue a 1 m move. Log actual vs. commanded position in a trace. Confirm deceleration begins at the correct residual distance.
  5. Tune K for the error-squared law. Step moves of 5, 10, 25, 50 m. Adjust K so the carriage enters creep band at the same residual distance (±10 %) for all moves.
  6. Run the full 10×10 cell matrix. Random order, 100 moves. Log cycle time, peak current (via PZD-3), and overshoot. Acceptance criteria: cycle ≤ 1.2× design, no overshoot > 5 mm, no fault trip.
  7. Force a PROFIBUS dropout by unplugging the slave mid-move. The S7-300 should call OB86, the drive must coast or brake to zero per its parameter P1121, and the PLC must reset the profile state machine on reconnect.
  8. Force a sensor dropout by obstructing the laser. The PLC must clamp speed to 0 within 50 ms.

10. Tuning and Field-Proven Caveats

  • Drive ramp vs. PLC ramp. The MM440 P1120/P1121 should be set shorter than the PLC's ramp, not longer. The drive ramp is the safety brake; the PLC ramp is the polite profile. If the PLC ramp is the slow one, the drive will follow the PLC command but will clamp acceleration. If the drive ramp is the slow one, the PLC S-curve will be flattened at the rate the drive is willing to accept — which is often exactly the behaviour you want for mechanical reasons, but is not what the math says.
  • Bipolar vs. unipolar setpoint. Always use a bipolar setpoint. On overshoot the same error-squared law decelerates and reverses the carriage; with unipolar the drive coasts past the target and the next move starts from a wrong position.
  • Feedback filtering. A 100 ms low-pass on the SICK reading is the right starting point. A 10 ms filter is too tight (noisy) for a 0.05 m/s creep, a 1 s filter is too slow (introduces position lag of up to 1.75 m at max speed). The 100 ms / 1.75 m/s worst-case lag is 175 mm and is dominated by mechanical hysteresis of the gear train, not by the filter.
  • Y-axis (10 m) requires a faster creep band. Absolute error of 5 mm on a 10 m axis is 0.05 %; on a 50 m axis it is 0.01 %. Cell repeatability must therefore be expressed in mm, not percent. Most SICK sensors will meet this, but verify on-site.
  • Z-axis needs a brake. The Z motor must hold position when at the cell. Set P1240 = 1 (DC brake) and P1234 = 5 % rated current. The PLC must keep the enable word (PZD bit 0) ON throughout the dwell, otherwise the load drops.
  • Watch the PROFIBUS watchdog. The MM440 will drop out if it does not receive a new PZD within its DP watchdog time. Set P2042 = 10 ms (or use the S7 master watchdog) to trip quickly on cable break.
  • Cross-coupling. When both X and Y are moving, the trajectory generators must be synchronised. The easiest method is to issue both setpoints from the same OB35 and let the higher-level scheduler pick the axis with the longest remaining move as the master clock.

11. Troubleshooting Matrix

Table 4 — Common hoist positioning faults and remedies
Symptom Root cause Diagnostic Remedial action
Carriage oscillates around target K too high; creep band too tight; laser filter too fast Trend PV vs. SP at 10 ms in trace Reduce K by 30 %, increase creep band to 0.1 m, increase filter to 200 ms
Move is jerky on start Drive P1120 = 0; PLC ramp truncated Read PZD actual frequency and check dF/dt Set P1120 = 0.05 s only, never zero
Z load drops when at cell DC brake disabled or PLC drops enable Read P1240, monitor PZD bit 0 Set P1240 = 1, P1234 ≥ 5 %, keep PZD bit 0 = 1
Cell-to-cell cycle slower than design Drive not reaching P1082; PLC ramp truncated by drive P1120 Read PZD actual frequency at steady state Match P1082 to motor max Hz, reduce P1120 to ≤ 0.1 s
Drive faults F0001 (overcurrent) on Z axis Mechanical brake on motor output is releasing late Listen for brake chatter; log PZD-3 current Sequence brake release 0.2 s before first command; adjust brake rectifier
Carriage passes target then returns Bipolar setpoint issue; PLC sign math wrong Look at word sent to PZD-2 in HEX Confirm 0xC000 corresponds to negative direction, not 0x0000
PROFIBUS BF on drive Address conflict, cable break, terminator missing Drive LED + STEP 7 online diagnostics Unique P0918 per slave, fit terminator on last slave, replace cable
No motion, PZD ok, drive ready P0700 or P1000 not set to 6 Read P0700 / P1000 from PKW Write P0700 = 6, P1000 = 6, save, power cycle

12. Summary

Migrating a pick-and-place hoist from S5 to S7-300 with PROFIBUS DP MICROMASTER drives and SICK laser position feedback unlocks cycle-time improvements of 25 % or more without any mechanical changes. The key engineering choices are: (1) a position-based speed command (error-squared law) for the trim phase, (2) a 4th-order S-curve polynomial for the long move, (3) keeping the drive's internal ramp very short so the PLC owns the trajectory, and (4) using a bipolar speed setpoint so that any overshoot is recovered automatically. Commissioning follows the same pattern as the original S5 system but with PROFIBUS diagnostics, structured STEP 7 code, and ISO 13849-1 safety compliance that the legacy system likely lacked.

What is the best positioning method for a 50 m hoist axis with a SICK laser sensor?

Use a hybrid: a 4th-order S-curve polynomial for the long move, then an error-squared speed command v = sign(SP−PV)·min(MaxSpeed, K·√|SP−PV| + MinSpeed) for the trim, with a discrete band at 0.05 m as the safety net. The S-curve handles jerk, the error-squared law handles creep, and the band logic guarantees a stop.

How long should the MM440 internal ramp P1120 be when the PLC owns the trajectory?

Set P1120 and P1121 to ≤ 0.05–0.1 s. The drive's internal ramp is the safety backup, not the motion profile. If the drive ramp is longer than the PLC's ramp, the drive clamps acceleration and the S-curve is flattened, which is mechanically fine but mathematically not what was designed.

How is the 4th-order S-curve evaluated in STEP 7 SCL?

Use the normalised polynomial p(τ) = 10τ³ − 15τ⁴ + 6τ⁵ with τ = t/T. Recompute τ in OB35 each cycle and integrate velocity rather than re-evaluating absolute position to avoid floating-point drift. For a 50 m axis traversed in 40 s the peak velocity is 1.875·(L/T) = 2.34 m/s and peak acceleration is 7.5·(L/T²) = 0.94 m/s² — well below the 0.4 m/s² legacy limit if T is lengthened to ~70 s.

How is the MM440 speed setpoint scaled in PZD on PROFIBUS DP?

0x4000 = +100 % = P2000 reference frequency (typically 50 Hz), 0x0000 = 0, 0xC000 = -100 %. Convert the desired m/s to Hz using the motor/gear ratio, then to a 16-bit normalised integer with REAL_TO_INT( f_Hz / P2000 * 16384.0 ). Use SFC15 DPWR_DAT to write the PZD output image consistently from OB35.

Why use a bipolar speed setpoint on a hoist axis?

A bipolar setpoint lets the same control law (error-squared, S-curve) decelerate and reverse on overshoot. With a unipolar 0–100 % setpoint the drive coasts past the target and the next move starts from a wrong position. Bipolar also allows the Z-axis to be lowered with a positive command while the gravity load is well controlled.

What sensor update rate is sufficient for a 1.75 m/s hoist axis?

A 1–3 ms update is fine; the bottleneck is the OB35 / PROFIBUS cycle, not the sensor. More important is the analog low-pass filter on the PLC input: 100 ms is the correct balance between ripple rejection and the 175 mm worst-case position lag at max speed.

Back to blog