BlockWerk Documentation
πŸ—

Input Shaper

Dynamics

The Input Shaper removes the swing from a move. A crane that jerks its trolley to a new

position sets the hanging load swinging, and the operator waits for it to die out. An

input shaper sends the same move as two (or three) smaller steps, timed half a swing

period apart: the first step starts a swing, the second starts an equal and opposite one,

and the two cancel. The load arrives and stays put.

The price is time β€” every move takes half a swing period longer (ZV) or a full one (ZVD)

β€” and knowledge: the shaper must know the load's natural frequency. ZV is the fastest but

leaves a noticeable swing if that frequency is off by more than a few percent; ZVD takes

twice as long and tolerates an error of about 15 %, for example a rope length that varies.

Simulate in BlockWerk

Interactive sandbox directly in your browser β€” zero installation, WASM-powered.

Simulate in BlockWerk →

Mathematical Model

Ο‰d=Ο‰n1βˆ’ΞΆ2,td=πωd,K=eβˆ’ΞΆΟ€/1βˆ’ΞΆ2\omega_d = \omega_n\sqrt{1-\zeta^2}, \quad t_d = \frac{\pi}{\omega_d}, \quad K = e^{-\zeta\pi/\sqrt{1-\zeta^2}}
ZV:Β y(t)=u(t)+K u(tβˆ’td)1+K,ZVD:Β y(t)=u(t)+2K u(tβˆ’td)+K2 u(tβˆ’2td)(1+K)2\text{ZV: } y(t) = \frac{u(t) + K\,u(t - t_d)}{1 + K}, \qquad \text{ZVD: } y(t) = \frac{u(t) + 2K\,u(t - t_d) + K^2\,u(t - 2t_d)}{(1 + K)^2}

Where:

  • u (input Cmd) is the unshaped command
  • y (output Shaped) is the shaped command, sent to the drive
  • A₁, Aβ‚‚, A₃ (outputs) are the pulse amplitudes; they sum to 1, so the shaped

command ends where the command does

  • T (output) is the time the shaper adds to each move: td for ZV, 2td for ZVD

The delayed commands are read from a history of samples with linear interpolation,

because td is rarely a whole number of samples. The history holds 8192 samples:

81.9 s at the default 0.01 s sample time.

Inputs & Outputs

Direction ID Label Type Status
→ In in1 Cmd number Required
← Out shaped Shaped number Output
← Out pulse1 A₁ number Output
← Out pulse2 Aβ‚‚ number Output
← Out pulse3 A₃ number Output
← Out shaperTime T number Output

Parameters

Parameters Label Type Default Description
naturalFreq Natural Frequency (Ο‰β‚™) number 0.5 Undamped natural frequency of the load; √(g/L) for a pendulum of length L
damping Damping Ratio (ΞΆ) number 0.05 Damping ratio of the load; crane pendulums are typically 0.01 to 0.1
shaperType Shaper Type select ZV ZV is fastest but sensitive to a wrong frequency; ZVD takes twice as long and tolerates about 15 % error

Usage Examples

Swing-Free Crane Move

The same 10 m trolley move drives two identical pendulum loads, modelled as

second-order systems with Ο‰n = 0.5 rad/s and ΞΆ = 0.05. Sent straight, the load

overshoots by almost the full move and is still swinging at the end of the run. Sent

through a ZV shaper tuned to the same pendulum, the load arrives 6.3 s later and does not

swing at all.

Remarks & Best Practices

  • Shaping acts on the command, outside the loop: it cannot correct a swing that a gust or

a collision starts. It prevents the swing the move itself would cause.

  • A shaped step is a staircase, so the drive still sees steps. Shape a smooth trajectory,

or put a rate limiter after the shaper, when the drive cannot follow steps.

  • Tune naturalFreq to the real swing: measure the period P of a free swing and use

2Ο€/P.

Related Components