Here is the schematics for the question:

enter image description here

I was using the LM311 as a non-inverting comparator without problem.

It works fine and here is the output below:

enter image description here

But if I use it as an inverting comparator, I get the following output below. As you see the output pulses have distorted tips. I circled one of them with orange color.

enter image description here

Is my transformation of the non-inverting comparator to an inverting comparator just by swapping inputs correct? How can I fix those non-flat corners?

  • \$\begingroup\$ Your circuit has a feedback loop. What is this for? Can you remove the feedback R5 and R10? \$\endgroup\$ – Greg d'Eon Dec 11 '15 at 16:33
  • \$\begingroup\$ oh yes i removed them both works fine now. besides that, do you think swapping inputs is enough? \$\endgroup\$ – user16307 Dec 11 '15 at 16:36
  • \$\begingroup\$ Note that the feedback (through R5 and R10) should be a positive feedback which gives you hysteresis. It means that the "flip high" and "flip low" voltages get separated. R5 is placed correctly to the + input giving pos. feedback. R10 is NOT placed correctly, it gives negative feedback here and that reduces the gain which is undesired if you want to make a comparator ! \$\endgroup\$ – Bimpelrekkie Dec 11 '15 at 16:42
  • \$\begingroup\$ do you mean R5 should be there but R10 should be removed? is that right what i understand? \$\endgroup\$ – user16307 Dec 11 '15 at 16:43
  • \$\begingroup\$ R10 should not feed-back to the - input but to the + input. You might then also need to make C2 smaller or even remove it as that reference voltage will go up and down slightly when the output switches. \$\endgroup\$ – Bimpelrekkie Dec 11 '15 at 16:49

I suspect that this has something to do with the feedback loop (connected through R5 and R10).

Your non-inverting comparator looks like:


simulate this circuit – Schematic created using CircuitLab

and your inverting comparator looks like


simulate this circuit

In the non-inverting comparator, you have positive feedback: when input > bias, the output swings high, which makes the input even higher! That way, the output voltage stays where it is.

However, in the inverting comparator, you have a negative feedback loop: when the output goes high, it drags the input voltage a little bit lower, which makes the comparator turn back off. This is the "ringing" that you see.

All you need to do (as I mentioned in the comments) is take out this feedback - a comparator doesn't need it. This should remove your overshoot.

  • \$\begingroup\$ just to be sure in both inverting and noniverting there shouldnt be any feedback rght? \$\endgroup\$ – user16307 Dec 11 '15 at 16:41
  • \$\begingroup\$ Correct. If you go hunting for LM311 circuits online, you'll notice that none of them have feedback. \$\endgroup\$ – Greg d'Eon Dec 11 '15 at 16:42
  • 1
    \$\begingroup\$ In a comparator you can have feedback but that should be POSITIVE feedback which results in hysteresis. But then you've made a schmitt-trigger instead of a pure comparator ! So negative feedback: no; positive feedback: only if you want it. \$\endgroup\$ – Bimpelrekkie Dec 11 '15 at 16:44
  • \$\begingroup\$ hmm so is that fine both have positive feedback? \$\endgroup\$ – user16307 Dec 11 '15 at 16:45
  • \$\begingroup\$ schmitt-trigger is better for my application since i want to sharpen pulses \$\endgroup\$ – user16307 Dec 11 '15 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.