I am studying comparators and Schmitt triggers. And I did not find anywhere how to choose the value of hysteresis. I understand its purpose and I know how to calculate it. But what value is needed for a particular scheme? Is any rule to choose that value?
The correct value of hysteresis voltage depends entirely on your application, and you haven't told us anything about that.
Basically, you should consider three factors:
- What is the minimum voltage that should look like a "high" input to the comparator?
- What is the maximum voltage that should look like a "low" input to the comparator?
- What is the maximum voltage of the noise on my signal?
You probably want to make sure that the hysteresis voltage is greater than your noise voltage to prevent false triggering. Hopefully, the magnitude of the noise is less than the difference between your input high and low levels. If so, then set the hysteresis trigger points at the high and low levels you specified.
Ivan Perez Rodriguez with a few words has already given you an explanation for which I would not be able to be so short. I find it exact, but as my habit I prefer to add a few more words, with the risk of exaggerating and writing more than I need, perhaps confusing the reader and even myself.
I suggest you think about hysteresis in a 'graphical' way, that is, figuring a band that goes from GND to the power supply and add within it (within its extremes) a band of voltage where the variations inside it, you want to have no effect on the your circuit.
I think at that point, the reasoning to do and the calculations to be performed are reduced to the simple Ohm law. From experience I find useful to use a spreadsheet to help me choose the pair of resistors that determine the hysteresis.
The resistor that reaches the input '-' from the output decreases the threshold voltage by a value that depends on the ratio between this resistance and that from the input '-' goes towards GND. If the negative feedback resistance is 9900 Ohm and the other is worth 100, then when the comparator will switch (and its output will go towards the positive) it will happen that the current in the two resistors will reduce (sinking) the comparator threshold by 1/100 of what it was fixed.
The opposite will happen when the input voltage is below the threshold, because in that state the output gives the current a current that this time will increase the comparator threshold by 1/100 of the value to which it was fixed.
My exposure is not precise, but I think that it can make you the idea of what you are looking for.
I can only think of two applications:
- Directly as a comparator. Here hysteresis is used to ignore variations in an input (for example, noise) unless they go above a certain threshold. This eliminates unwanted switching, for example.
- As an oscillator, hysteresis window dictates the amplitude of the oscillation.
If input signal Vpp is same as output swing, then with Hysteresis from 1/3 to 2/4 you can tolerate ~ 50% noise with 100% signal or an SNR of 2:1. This is how CMOS Schmitt triggers are designed for logic. The downside is a sine-wave, or slow rise time will have edge delay and duty cycle if ac coupled will affect the threshold, resulting in data edge jitter unless Bi-phase.
Therefore your Hysteresis Vpp must be greater than your noise Vpp. Otherwise, you must reduce your noise Vpp with a filter.
Ideally, you define; signal level, signal BW, rise time, SNR and max comparator jitter error then choose hysteresis to give you perfect results or infinite SNR output with acceptable jitter.
- e.g. 2% noise pp worst case, then > 3% hysteresis with only 1% margin or > 10-% hysteresis with 8% margin but an extra 6% rise time delay and possibly jitter from unequal delays rising and falling.
It is easy to pick up noise from SMPS stray coupling on a pair of data wires or crosstalk on high-speed signals, unbalanced or unshielded signals near disturbances and a mobile phone sync every few minutes near cables.
Ideally, you think about the impedance and voltage of signals and use low impedances for the noise spectrum to maximize your SNR before deciding hysteresis, when possible. Noise can be induced by conducted or radiated sources when an unbalanced sender or receiver is used.
You design the comparator to be suitable for your input signal.
Input signal swings within the hysteresis band will be ignored, signal swings outside the hysteresis band will be followed.
If your input signal has small noise excursion, and large signal excursions, then you design the hysteresis to be intermediate between the two.
If your input signal has noise excursions larger than the signal, then hysteresis will not solve the problem.