πŸ—

Input Shaper

Dynamics
Run the live example Free Β· no sign-up Β· runs in your browser

The InputShaper block implements Zero Vibration (ZV) and Zero Vibration and Derivative (ZVD) feedforward input shaping algorithms to suppress residual structural oscillations in flexible mechanical systems. By convolving an arbitrary motion command with a carefully timed sequence of discrete impulses, the oscillatory motion initiated by the first impulse is canceled out by subsequent delayed impulses. The Property Editor features a live Impulse Train preview (InputShaperInsights) showing the exact normalized pulse amplitudes A1,A2,(A3)A_1, A_2, (A_3), timing offsets t1,t2,(t3)t_1, t_2, (t_3), damped period TdT_d, and total shaper duration Ξ”T\Delta T.

Mathematical Model

Let Ο‰n\omega_n be the undamped naturalFreq and ΞΆ\zeta the damping ratio of the oscillatory plant mode (0≀΢<10 \le \zeta < 1). The damped natural frequency Ο‰d\omega_d, half-period delay time tdt_d, and impulse damping ratio KK are:

Ο‰d=Ο‰n1βˆ’ΞΆ2,td=πωd,K=exp⁑(βˆ’ΞΆΟ€1βˆ’ΞΆ2)\omega_d = \omega_n \sqrt{1 - \zeta^2}, \quad t_d = \frac{\pi}{\omega_d}, \quad K = \exp\left(-\frac{\zeta \pi}{\sqrt{1 - \zeta^2}}\right)

The shaped output command y(t)y(t) is generated based on the selected shaperType:

Zero Vibration (ZV) Shaper (2 Pulses):

y(t)=u(t)+Kβ‹…u(tβˆ’td)1+Ky(t) = \frac{u(t) + K \cdot u(t - t_d)}{1 + K}

with impulse times {0,td}\{0, t_d\} and normalized amplitudes A1=11+K,A2=K1+KA_1 = \frac{1}{1 + K}, A_2 = \frac{K}{1 + K}.

Zero Vibration and Derivative (ZVD) Shaper (3 Pulses):

y(t)=u(t)+2Kβ‹…u(tβˆ’td)+K2β‹…u(tβˆ’2td)(1+K)2y(t) = \frac{u(t) + 2K \cdot u(t - t_d) + K^2 \cdot u(t - 2t_d)}{(1 + K)^2}

with impulse times {0,td,2td}\{0, t_d, 2t_d\} and normalized amplitudes A1=1(1+K)2,A2=2K(1+K)2,A3=K2(1+K)2A_1 = \frac{1}{(1 + K)^2}, A_2 = \frac{2K}{(1 + K)^2}, A_3 = \frac{K^2}{(1 + K)^2}.

Delayed signal values u(tβˆ’ktd)u(t - k t_d) are extracted from an internal circular history buffer via linear interpolation.

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

Example 1: Swing-Free Overhead Gantry Crane Trolley Positioning

Transferring an industrial container across an overhead crane with cable length L=39.2Β mL = 39.2\text{ m} (Ο‰n=9.81/39.2=0.5Β rad/s\omega_n = \sqrt{9.81 / 39.2} = 0.5\text{ rad/s}) and ΞΆ=0.02\zeta = 0.02. Configuring a ZV shaper with naturalFreq = 0.5, damping = 0.02, and shaperType = "ZV". When a 10Β m10\text{ m} step displacement is commanded, the shaped trajectory divides motion into two balanced steps timed tdβ‰ˆ6.28Β st_d \approx 6.28\text{ s} apart; the container arrives at the target position with zero residual swing.

Example 2: Flexible Robotic Arm Vibration Suppression under Payload Variation

Moving a flexible robotic manipulator where tool payload mass variations cause natural frequency uncertainty (Ο‰n∈[18,22]Β rad/s\omega_n \in [18, 22]\text{ rad/s}). Configuring naturalFreq = 20.0, damping = 0.05, and shaperType = "ZVD". The three-pulse ZVD shaper provides a wide zero-derivative notch, suppressing residual tip oscillations to below 2%2\% despite significant payload mass changes.

Remarks & Best Practices

  • Live Impulse Train Diagram: The Property Editor visualizes the 2-pulse (ZV) or 3-pulse (ZVD) stem plot with exact amplitude percentages and timestamps in seconds as you adjust Ο‰n\omega_n and ΞΆ\zeta.
  • Feedforward Nature: Input shaping acts strictly on the command signal outside the feedback loop. It prevents the move itself from inducing vibrations, but cannot reject external wind gusts or collision disturbances acting directly on the plant.
  • Delay vs. Robustness Trade-off: ZV adds half a vibration period (tdt_d) of motion delay; ZVD adds a full period (2td2t_d) but provides much broader frequency error tolerance.
  • Actuator Smoothness: The shaped output of a step input resembles a staircase. If the motor drive cannot accept abrupt step commands, place a RateLimiter or first-order lag filter after the input shaper.
  • Internal State Buffer: Implemented with an internal circular delay buffer in WebAssembly, interpolating between discrete simulation steps with high accuracy.

Frequently Asked Questions (FAQ)

Q: How does Zero Vibration (ZV) input shaping eliminate structural vibration in cranes and robots?

ZV input shaping convolves the motion command with a sequence of two impulses whose amplitudes A1=11+K,A2=K1+KA_1 = \frac{1}{1 + K}, A_2 = \frac{K}{1 + K} (where K=eβˆ’ΞΆΟ€/1βˆ’ΞΆ2K = e^{-\zeta \pi / \sqrt{1-\zeta^2}}) and time spacing Ξ”T=πωn1βˆ’ΞΆ2\Delta T = \frac{\pi}{\omega_n \sqrt{1-\zeta^2}} equal half the damped oscillation period. The second impulse induces an oscillation exactly 180∘180^\circ out of phase with the first, canceling residual vibration completely without reducing maximum actuator acceleration.

Related Components

  • SecondOrderSystem: Canonical continuous second-order dynamic plant model.
  • RateLimiter: Limits the rate of change of shaped command signals.
  • Delay: Pure transport delay block.
  • LeadLag: First-order phase lead/lag dynamic compensator.