Comparator

Comparator with Hysteresis

 Description The Comparator models an ideal comparator with hysteresis. The input impedance is infinite. The output goes high when $\frac{{V}_{\mathrm{hys}}}{2}<{v}_{p}-{v}_{n}$. It goes low when ${v}_{p}-{v}_{n}<-\frac{{V}_{\mathrm{hys}}}{2}$. When the output is high, the output pin is connected to the high supply pin, $\mathrm{hi}$, through a resistance ${R}_{\mathrm{on}}$, and is connected to the low supply pin, $\mathrm{lo}$, through a conductance ${G}_{\mathrm{off}}$. When the output is low, the output pin is connected to the high supply pin, $\mathrm{hi}$, through a conductance ${G}_{\mathrm{off}}$, and is connected to the low supply pin, $\mathrm{lo}$, through a resistance ${R}_{\mathrm{on}}$.

Connections

 Name Description Modelica ID $\mathrm{out}$ Output pin out $p$ Positive input p $n$ Negative input n $\mathrm{hi}$ High supply pin hi $\mathrm{lo}$ Low supply pin lo

Parameters

 Name Default Units Description Modelica ID ${V}_{\mathrm{hys}}$ 0.001 $V$ Hysteresis voltage Vhys ${R}_{\mathrm{on}}$ 0.001 $\mathrm{\Omega }$ On-state resistance Ron ${G}_{\mathrm{off}}$ 0.001 $S$ Off-state conductance Goff