# Hysteresis equations

Discussion in 'General Electronics Chat' started by matthew798, Jan 18, 2013.

1. ### matthew798 Thread Starter Member

Jan 16, 2013
38
2
Hello everyone.

I was hoping someone could just clarify the following equation for me. Here is the circuit I am working with:

The equation I am having trouble with is: V+ = VIN ∙ R2/(R1 + R2) + Vo ∙ R1/(R1 + R2)

For the calculations, I am assuming that: Vref = 2.5v, VIN = 5v, Vo = 5v, R1 = 1kΩ, R2 = 5kΩ.

I started like this:

Lower threshold: 2.5 = (X ∙ 5k / 6k )+(5 ∙ 1k / 6k) so X = 2v

The upper threshold, assuming this time that Vo = 0, is 3v. This makes sense!

The only problem is that further down in the tutorial I am reading it says:
Vth+ = - VN ∙ R1 / R2
Vth- = - VP ∙ R1 / R2

Did I not just calculate the upper and lower thresholds? 2v and 3v?

So I guess my question is: What the heck did I calculate? It seemed to make sense...

I know I should have a decoupling capacitor, and a few more improvements but for now I'm trying to understand the basic maths of it.

Thanks!!

Oh yeah, P.S. if anyone could quickly explain the function of those 2 zener diodes it would be great

2. ### ECC83 New Member

Jan 6, 2013
13
0
The two zener diodes are limiting diodes. If you've got a +/-15V power supply, your choice of zener diodes will define the upper and lower limits. So if you want to limit to +/- 7.5V you'd choose two zener's to match that.

Notice that resistor Rlim, that too is required for the zener's to work correctly I think, someone can probably clarify it better than me.

3. ### WBahn Moderator

Mar 31, 2012
18,093
4,920
Why are you assuming Vo is 0V or 5V? What are the opamp's power rails? How close to the rails can it get? What about the effect of Rlim? And then, of course, there's the diodes. Are you sure that the feedback path starts after Rlim and not directly at the opamp output? Because the way you have it drawm makes the thresholds load-dependent.

Without information abouit the context of the tutorial where they give those equations, I have no idea whether they are even talking about the same circuit.

4. ### vrainom Member

Sep 8, 2011
109
19
If we assume that is an ideal circuit then your values are correct. Let me brake it down for you. I'm assuming you're familiar with Ohm's law.

R1 and R2 form a voltage divider of the potential difference between Vin (node 2) and the output of the opamp Vo (node 5). The voltage in node 3 must be a tiny bit lower or higher than Vref to get a state change in Vo, so if we work with 2 decimals the difference is negligible. Knowing Vo's low and high voltages, we can calculate the voltage drop across R2 needed to achieve a state change in Vo and therefore the voltage difference between Vin and Vo:

Vin = Vref + R1v = Vref + (R1 * ((Vref - Vo) / R2))

That is, the voltage at the input must be the voltage reference plus the voltage drop across R1, calculated from the known voltage drop across R2.

Now the excruciatingly long break down: at the initial state the opamp's output Vo is 0v, so to achieve a change state we need a voltage drop across R2 of:

Vref - Vo = 2.5v - 0v = 2.5v

So we calculate the current :

2.5v / 5000 = .0005a

The voltage across R1 then is:

.0005a * 1000 = .5v

So the voltage at Vin must be:

Vref + R1v = 2.5v + .5v = 3v

Then the comparator changes states and Vo goes to 5v, now the voltage at node 3 is:

Vin - Vo = 3v - 5v = -2v
R1v = R1 * (-2v / (R1 + R2)) = 1000 * (-2v /6000) = -.33v
Vin - R1v = 3v - (-.33v) = 3.33v

Now to go back to the low state we need a voltage drop across r2 of:

Vref - Vo= 2.5v - 5v= -2.5v

So again:

-2.5v / 5k = -.0005

And the voltage across r1:

-.0005 * 1k = -.5v

So the voltage at Vin must be

Vref + R1v = 2.5v + (-.5v) = 2v

And at this point Vo becomes 0v and the voltage at node 3 becomes:

Vin - Vo = 2v - 0v = 2v
R1v = R1 * (2v / (R1 + R2)) = 1000 * (2/6000) = .33
Vin - R1v = 2v - .33v = 1.66v

In this case the hysteresis loop is very symetric since Vref is exactly half of the output swing of the comparator.

Now this is an ideal circuit, in a real circuit there are more things to take into consideration, like the opamp's real output swing, its output impedance and voltage drop with load, the offset voltage between the + and - input, the inputs' impedance and the resistance of R2 being in series with Rlimit and in parallel with the load, adding complexity to the node.

Last edited: Jan 20, 2013