Compare Input » History » Revision 3
Revision 2 (Adam Klama, 05/06/2025 02:33 PM) → Revision 3/5 (Adam Klama, 05/06/2025 02:37 PM)
# **Compare Compare Input Description** The **Compare Input** Compare Input block evaluates a selectable system signal against a user-defined threshold defined condition using flexible comparison logic. It supports hysteresis, optional filtering, and timing control for stable and precise event detection. can be used to monitor system states, trigger events, or activate logic transitions based on real-time signal values. --- ## **1. 1. Input Source** Source The user can select a signal from any available system variables (e.g., coolant temperature, pressure, RPM) to use signal as the input for comparison. to the comparison block. This could include analog or digital measurements such as temperature, pressure, or speed. --- ## **2. 2. Comparison Modes** Specifies Modes The mode determines how the input signal is evaluated relative compared to a defined `Value`. user-defined threshold (Value). Supported modes: - ### **Equal** - Equal: Output is `true` triggered only when the input equals the specified `Value`. - `Deviation` signal is **forced exactly equal to 0** Value. Deviation is forcibly set to zero in this mode — no tolerance or hysteresis applies. Best suited for discrete signal matching or tolerance is applied. - Ideal for detecting exact matches. edge conditions. - ### **Window Compare** - Window Compare: Output is `true` true when the input is lies within the range: ``` range Value - Deviation ≤ Input ≤ Value + Deviation ``` - ± Deviation. Output is `false` false when the input signal is outside this range. - Useful for checking whether a signal is inside a safe or valid or safe operating windows. range. - ### **LessThan** - 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 turns `true` when: ``` Input switches on when signal < Value - Deviation ``` - Output turns `false` when: ``` Input switches off when signal > Value + Deviation ``` - ### **GreaterThan** - GreaterThan: Output turns `true` when: ``` Input switches on when signal > Value + Deviation ``` - Output turns `false` when: ``` Input switches off when signal < Value - Deviation ``` > These hysteresis thresholds prevent output toggling due to small signal oscillations. --- ## **3. Value** 3. Value The central threshold reference value used in all comparison modes. calculations. --- ## **4. Deviation** 4. Deviation Defines the hysteresis band or tolerance around the `Value`. Value. - Used in **Window Compare**, **LessThan**, Window, LessThan, and **GreaterThan** GreaterThan modes. - Helps filter out prevent output instability due to signal noise or rapid transitions. - **Not fluctuations near the threshold. Not used in Equal mode** (automatically set mode (forced to 0). --- ## **5. 5. Filter Enable** Controls Enable This flag controls how the input signal is processed and whether how timing constraints are applied. logic (Delay and Cooldown) behaves: - ### **Filter Disabled** - Filter Disabled: The Compare Input operates works in **level-based mode**. - Output level-based mode. The output reacts **immediately** immediately to input crossing thresholds. - **Delay** threshold crossings. Delay and **Cooldown** Cooldown are **ignored**. ignored. - ### **Filter Enabled** - Filter Enabled: The Compare Input operates in **event-based mode**. - Output is triggered switches to event-based behavior. Triggers are detected on **rising/falling transitions** rising/falling transitions of the condition. - **Delay** Delay and **Cooldown** Cooldown become active: - `Delay`: suppresses short glitches. - `Cooldown`: active and fully evaluated: Ensures stable detection and prevents rapid retriggering. false triggering from transient conditions. --- ## **6. Delay** - Only evaluated 6. Delay Applies only when **Filter Filter is enabled**. - Enabled. The input condition must remain continuously valid continuously for the full **Delay time** Delay time before the output is activated. --- Used to suppress short-term glitches or noise. ## **7. Cooldown** - Only evaluated 7. Cooldown Also applies only when **Filter Filter is enabled**. - Enabled. Defines the **minimum minimum time that must pass after the end of the previous trigger condition** during which before a new events are ignored. - Prevents repeated or bouncing events immediately after a trigger ends. can be accepted. --- This ensures stability by preventing immediate retriggering after condition resets. ## **Example Configuration** ```text Example Configuration Input: Coolant Temperature Mode: LessThan Value: 80 Deviation: 3 Filter: Filter Enable: Enabled Delay: 50 ms Cooldown: 200 ms ``` ### **Behavior** - Behavior: Output turns **on** activates when the input signal drops below **77°C** 77°C and stays there for **at at least 50 ms**. - Output turns **off** when ms. Once the input condition ends (temperature rises above **83°C**. - After turning off, 83°C), the system **waits waits 200 ms** ms before allowing another the next trigger.