Project

General

Profile

Actions

Compare Input » History » Revision 2

« Previous | Revision 2/5 (diff) | Next »
Adam Klama, 05/06/2025 02:33 PM


Compare Input

The Compare Input block evaluates a selectable signal against a defined condition using flexible comparison logic. It can be used to monitor system states, trigger events, or activate logic transitions based on real-time signal values.

  1. Input Source
    The user can select any available system signal as the input to the comparison block. This could include analog or digital measurements such as temperature, pressure, or speed.

  2. Comparison Modes
    The mode determines how the input signal is compared to a user-defined threshold (Value). Supported modes:

Equal:

Output is triggered only when the input signal is exactly equal to Value.

Deviation is forcibly set to zero in this mode — no tolerance or hysteresis applies.

Best suited for discrete signal matching or edge conditions.

Window Compare:

Output is true when the input lies within the range Value ± Deviation.

Output is false when the signal is outside this range.

Useful for checking whether a signal is inside a safe or valid range.

LessThan / GreaterThan (with hysteresis):
These modes compare the signal relative to a threshold and apply hysteresis to prevent toggling due to small signal oscillations:

LessThan:

Output switches on when signal < Value - Deviation

Output switches off when signal > Value + Deviation

GreaterThan:

Output switches on when signal > Value + Deviation

Output switches off when signal < Value - Deviation

  1. Value
    The central reference value used in all comparison calculations.

  2. Deviation
    Defines the hysteresis band around the Value.

Used in Window, LessThan, and GreaterThan modes.

Helps prevent output instability due to signal noise or fluctuations near the threshold.

Not used in Equal mode (forced to 0).

  1. Filter Enable
    This flag controls how the input signal is processed and how timing logic (Delay and Cooldown) behaves:

Filter Disabled:

The Compare Input works in level-based mode.

The output reacts immediately to threshold crossings.

Delay and Cooldown are ignored.

Filter Enabled:

The Compare Input switches to event-based behavior.

Triggers are detected on rising/falling transitions of the condition.

Delay and Cooldown become active and fully evaluated:

Ensures stable detection and prevents false triggering from transient conditions.

  1. Delay
    Applies only when Filter is Enabled.

The condition must remain continuously valid for the full Delay time before the output is activated.

Used to suppress short-term glitches or noise.

  1. Cooldown
    Also applies only when Filter is Enabled.

Defines the minimum time that must pass after the end of the previous trigger before a new trigger can be accepted.

This ensures stability by preventing immediate retriggering after condition resets.

Example Configuration
Input: Coolant Temperature

Mode: LessThan

Value: 80

Deviation: 3

Filter Enable: Enabled

Delay: 50 ms

Cooldown: 200 ms

Behavior:

Output activates when the signal drops below 77°C and stays there for at least 50 ms.

Once the condition ends (temperature rises above 83°C), the system waits 200 ms before allowing the next trigger.

Updated by Adam Klama 7 months ago · 5 revisions