I'm trying to be sure I'm computing the values for this circuit right. Here's an example of the circuit I'm trying to build (it's going in a 12 V DC system, so I filled that in already).
I have a textbook from electronics class several years ago (which is where the circuit design came from), and it has these formulas:
\$ V_{h}=hysteresis~width \$
\$ V_{ut}=upper~threshold~voltage \$
\$ V_{ctr}=center~of~threshold~voltages \$
\$ V_{lt}=lower~threshold~voltage \$
\$ V{ref}=comparator~reference~voltage \$
\$ n=resistor~multiplier~for~the~hysteresis~divider \$
\$ V_{h} = V_{ut}-V_{lt} \$
\$ V_{ctr}=\dfrac{V_{ut}+V_{lt}}{2} \$
\$ n=\dfrac{+V_{sat} -(-V_{sat})}{V_{h}}-1 \$
\$ V_{ref}=\dfrac{n+1}{n}V_{ctr} \$
So according to this, if I want the comparator that has Vut = 7 V and Vlt = 6 V I should have n=11 and Vref = 7.09 V to match my Vsat+ = 12 V and Vsat- = 0 V.
In ngspice (using an LF411 model from National Semiconductor) these values simulate an output that is more like Vut = 7.5 V, Vlt = 6.5 V. I even used exact resistor values (R = 10 kohm, nR = 110 kohm) instead of closest-available.
Is this a good circuit to use for my purpose? Should I normally have to tweak these values for real life? I've found that R = 10 kohm, nR = 75 kohm, and Vref = 6.5 V get me closer to the Vut = 7 V and Vlt = 6 V that I wanted, but those values are pretty far off from expected.