⏲️

Gauge

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

The Gauge block provides an analog semicircular dial instrument with an animated rotating needle on the canvas. It maps the instantaneous value of an incoming continuous or discrete signal to an angular needle deflection across a user-defined physical range [vmin⁡,vmax⁡][v_{\min}, v_{\max}]. The dial features a filled circular arc that expands proportionally with the signal magnitude and sweeps from −90∘-90^\circ (minimum) to +90∘+90^\circ (maximum), giving engineers an immediate visual sense of operating margin and proximity to safety limits.

Mathematical Model

The input signal u(t)u(t) is first clamped to the physical instrument operating span [vmin⁡,vmax⁡][v_{\min}, v_{\max}], where vmin⁡=minValuev_{\min} = \text{minValue} and vmax⁡=maxValuev_{\max} = \text{maxValue}:

uclamped(t)=clamp⁡(u(t),vmin⁡,vmax⁡)=min⁡(max⁡(u(t),vmin⁡),vmax⁡)u_{\text{clamped}}(t) = \operatorname{clamp}(u(t), v_{\min}, v_{\max}) = \min(\max(u(t), v_{\min}), v_{\max})

The normalized scale fraction η(t)∈[0,1]\eta(t) \in [0, 1] is:

η(t)=uclamped(t)−vmin⁡vmax⁡−vmin⁡\eta(t) = \frac{u_{\text{clamped}}(t) - v_{\min}}{v_{\max} - v_{\min}}

The physical needle angle θ(t)\theta(t) sweeps across a 180∘180^\circ semicircular arc:

θ(t)=−90∘+η(t)⋅180∘∈[−90∘,+90∘]\theta(t) = -90^\circ + \eta(t) \cdot 180^\circ \in [-90^\circ, +90^\circ]

A digital LCD-style numeric readout in the center of the dial displays the formatted value along with the configured engineering units:

display(t)=format⁡(u(t),1)  units\text{display}(t) = \operatorname{format}(u(t), 1) \; \text{units}

Inputs & Outputs

Direction ID Label Type Status
→ In in Input number Required

Parameters

Parameters Label Type Default Description
minValue Min Value number 0
maxValue Max Value number 100
units Units string

Usage Examples

Example 1: Chemical Reactor Vessel Temperature Monitoring

Monitoring core vessel temperature in an exothermic batch reactor. Setting minValue = 20.0, maxValue = 180.0, and units = "°C". As thermal reaction heating progresses, the operator can see the needle sweep smoothly from ambient into the optimal 120–140∘C120\text{--}140^\circ\text{C} operating band, providing instant visual feedback on proximity to the thermal runaway threshold.

Example 2: Normalized PID Control Error Envelope Inspection

Monitoring instantaneous tracking error in a closed-loop positioning servo. Feeding absolute error through an Abs block into a Gauge configured with minValue = 0.0, maxValue = 5.0, and units = "mm". During step transients, the needle deflects towards the upper limit and then returns smoothly to zero as steady-state error is eliminated.

Remarks & Best Practices

  • Terminal Sink Node: The Gauge block has no output ports and does not pass signals downstream; it functions strictly as an interactive visual monitoring probe.
  • Limit Clamping: Signal excursions outside [vmin⁡,vmax⁡][v_{\min}, v_{\max}] are clamped to the dial end-stops; the needle does not spin past ±90∘\pm 90^\circ, protecting against graphic rendering artifacts.
  • Central Digital Readout: In addition to the analog needle position, the dial displays a central digital readout formatted to one decimal place for quick quantitative checks.
  • High-Performance Canvas Rendering: Rendered using accelerated HTML5 canvas and SVG routines, imposing near-zero computational overhead on real-time simulation loops.

Related Components

  • NumericDisplay: Pure digital LCD numeric readout with configurable decimal precision.
  • uPlotDisplay: Multi-channel graphical oscilloscope for time-series waveforms.
  • SevenSegment: Digital hardware LED-style display.
  • Saturation: Clamps signals to defined limits.