Ramp
The Ramp node increases or decreases in a linear way the value of the Output connector until it reaches the value of the Input connector. The linear increment consists of adding (or subtracting) to the Output a value represented by the Step size property every time interval specified by the Time step property.
The value of the Output can't go beyond the Input value, so the node reduces the step to adapt the output to the input.
Behaviour of Ramp
Connectors
| Connector | Type | Description |
|---|---|---|
| Input | Input | Target analog value that the node must reach progressively. |
| Output | Output | Analog value generated by the node. It is increased or decreased step by step until it reaches the Input value. |
Main properties
| Property | Description |
|---|---|
| Step size | Value added to or subtracted from the Output at each step. |
| Time step | Time interval between two consecutive increments or decrements of the Output value. |
Operation
The Ramp node is used to change an analog value progressively instead of applying the final target value immediately.
When the value of the Input connector changes, the node compares it with the current Output value:
- if Input is greater than Output, the node increases the Output value;
- if Input is lower than Output, the node decreases the Output value;
- if Input and Output are equal, the output remains unchanged.
At every time interval defined by Time step, the node changes the Output value by the amount defined in Step size.
Conceptually:
Output(n+1) = Output(n) ± Step size
The node continues this operation until the Output value reaches the Input value.
The Output value never exceeds the Input value.
If the remaining difference is smaller than the configured Step size, the node automatically reduces the last step so that the output reaches the target exactly.
Example
Consider the following configuration:
| Property | Value |
|---|---|
| Step size | 5 |
| Time step | 1 s |
If the initial Output value is 20 and the Input value becomes 35, the Ramp node behaves as follows:
| Time | Output |
|---|---|
| 0 s | 20 |
| 1 s | 25 |
| 2 s | 30 |
| 3 s | 35 |
If the Input value then changes to 12, the node decreases the output:
| Time | Output |
|---|---|
| 0 s | 35 |
| 1 s | 30 |
| 2 s | 25 |
| 3 s | 20 |
| 4 s | 15 |
| 5 s | 12 |
In the last step, the node does not go below the target value. Instead, it adapts the final decrement to reach the Input value exactly.
Typical applications
The Ramp node is useful whenever a value must change smoothly over time instead of changing abruptly.
Typical applications include:
- progressive variation of a setpoint;
- smooth dimming or brightening transitions;
- gradual opening or closing values;
- avoiding sudden variations on controlled devices;
- creating analog transitions in logic sequences.
Verification through simulation
The Ramp node can be tested using the Logic Module simulation tools.
A typical test procedure is the following:
- connect a variable analog value to the Input connector;
- configure Step size and Time step;
- start the simulation;
- change the input value;
- observe how the Output value approaches the Input progressively;
- verify that the Output changes by the configured step at each configured time interval;
- verify that the last increment or decrement is automatically adapted when needed.
If the Input value changes again while the ramp is already in progress, the node continues adapting the Output toward the new target value.
Configuration notes
- A larger Step size makes the ramp faster.
- A smaller Step size makes the ramp smoother.
- A shorter Time step increases the update frequency of the output.
- A longer Time step slows down the transition.
- Choose Step size and Time step according to the required smoothness and response speed.
- The Ramp node is useful when abrupt value changes should be avoided.
- Always verify the final behaviour on the real installation if the ramp controls external devices or setpoints.
