ƒ

Ramp

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

Generates a linearly increasing or decreasing signal starting at a specified simulation time and advancing at a constant slope (rate of change). Unlike the discontinuous amplitude jump of a Step block, the Ramp block produces a continuous waveform ideal for generating smooth acceleration profiles, constant-velocity motion setpoints, soft-start power trajectories, and evaluating velocity tracking error constants (KvK_v) in closed-loop control systems. Supports optional clamping at a target finalValue and external edge-triggered resetting.

Mathematical Model

Without final value clamping (enableFinalValue = false), the output trajectory is defined as:

y(t)={y0,if t<tstarty0+S⋅(t−tstart),if t≥tstarty(t) = \begin{cases} y_0, & \text{if } t < t_{\text{start}} \\ y_0 + S \cdot (t - t_{\text{start}}), & \text{if } t \ge t_{\text{start}} \end{cases}

where y0y_0 denotes initialValue, SS denotes slope, and tstartt_{\text{start}} denotes startTime.

When final value clamping is activated (enableFinalValue = true), the output saturates smoothly at yfinaly_{\text{final}}:

  • For positive slope (S>0S > 0):
y(t)={y0,if t<tstartmin⁡(yfinal,y0+S⋅(t−tstart)),if t≥tstarty(t) = \begin{cases} y_0, & \text{if } t < t_{\text{start}} \\ \min\left(y_{\text{final}}, y_0 + S \cdot (t - t_{\text{start}})\right), & \text{if } t \ge t_{\text{start}} \end{cases}
  • For negative slope (S<0S < 0):
y(t)={y0,if t<tstartmax⁡(yfinal,y0+S⋅(t−tstart)),if t≥tstarty(t) = \begin{cases} y_0, & \text{if } t < t_{\text{start}} \\ \max\left(y_{\text{final}}, y_0 + S \cdot (t - t_{\text{start}})\right), & \text{if } t \ge t_{\text{start}} \end{cases}

In the Laplace domain (ss), the transform of an unbounded delayed ramp is:

Y(s)=y0s+Ss2e−ststartY(s) = \frac{y_0}{s} + \frac{S}{s^2} e^{-s t_{\text{start}}}

Inputs & Outputs

Direction ID Label Type Status
→ In trigger Trigger number Optional
← Out out Output number Output

Parameters

Parameters Label Type Default Description
slope Slope number 1
startTime Start Time number 0
initialValue Initial Value number 0
finalValue Final Value number 10 Maximum output value when Enable Final Value is true
enableFinalValue Enable Final Value boolean false When enabled, the ramp will stop at the Final Value

Usage Examples

Example 1: Velocity Error Constant (KvK_v) Tracking Assessment

In high-precision motion servomechanisms, calculating the steady-state tracking error under constant-speed velocity tracking requires a ramp input. Connecting a Ramp block with slope = 5.0 rad/s, startTime = 1.0 s, and initialValue = 0.0 into a position control loop allows engineers to quantify the velocity error constant Kv=lim⁡t→∞S/e(t)K_v = \lim_{t\to\infty} S / e(t), confirming Type-1 loop stiffness.

Example 2: Industrial Pump Soft-Start Pressure Ramp

In high-pressure water transmission pipelines, starting pumps abruptly generates damaging water hammer pressure shocks. Configuring a Ramp block with slope = 10.0 bar/s, startTime = 0.5 s, initialValue = 0.0 bar, finalValue = 80.0 bar, and enableFinalValue = true creates a controlled 8-second soft-start trajectory that smoothly brings system pressure up to working limits.

Remarks & Best Practices

  • Continuous Waveform with Corner Discontinuity: The output position is continuous (C0C^0), but its derivative changes abruptly at t=tstartt = t_{\text{start}}, allowing adaptive ODE solvers to adjust step sizes cleanly.
  • Edge-Triggered Reset Terminal: Applying a rising edge to the bottom trigger input reloads initialValue and restarts the ramp timing from the current simulation instant.
  • Infinite Linear Excursion Warning: When enableFinalValue = false, the output grows without bound over long simulation horizons; always verify that downstream actuators incorporate Saturation protection.
  • Double Pole at the Origin: In frequency analysis, a ramp excitation has a double pole at s=0s = 0 (1/s21/s^2), causing non-zero steady-state tracking lag in Type-1 systems and divergence in Type-0 systems.

Related Components

  • Step: Generates an abrupt step transition between two values.
  • RateLimiter: Restricts the maximum derivative of an arbitrary incoming signal.
  • Clock: Generates an unscaled linear simulation time signal (y=ty = t).
  • Saturation: Clamps signal excursions between configurable limits.