The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 29th, 2024, 7:20pm
Pages: 1
Send Topic Print
need help in designing a comparator with hysteresis (Read 3643 times)
mustakhim
New Member
*
Offline



Posts: 9

need help in designing a comparator with hysteresis
Mar 21st, 2010, 5:59pm
 
hye guys,

I'm building a comparator with hysteresis using an opamp, and I follow whats in the datasheets (LM324). Below is the circuit diagram of my design, and the output signal wave. I need to build a comparator which output voltage is +2V and -2V, and the hysteresis value Vt=1V. From the datasheets, i found that this formula is used to calculate the value of the resistors.

Vt=(R1/(R2 + R1))* (Voh - Vol), Voh is 2V and Vol is -2V.  From the calculation, I got R2/R1=3. I choose R2=300Ω and R1=100Ω.

The output voltage is not like what I was expected. The output voltage is amplified by the value of 3. This means that the circuit is not working as it should as I got an amplifier rather that a comparator. I try to figure it out for hours but still got no solution. My input voltage is set 5V, and my Vref is =0.

Hope you guys can help me. I'm totally lost here. Thanks in advance for any help!
Back to top
 

comparator_001.jpg
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: need help in designing a comparator with hysteresis
Reply #1 - Mar 21st, 2010, 7:43pm
 
When you say that you are not getting what you expected to get, presumably you are saying that a simulator is not giving you the answer you expect. Are you using behavioral models or circuits constructed from transistors? Are bandwidth effect modelled at all? If you used a behavioral model, did you model clipping?

You may getting a mathematically valid but impractical answer. To see if this is the case, try skipping the initial DC solution (skipdc with Spectre, UIC with SPICE (you will need some capacitors in your circuit)). Alternately, decrease the transition timeof the input source to the point where you would expect to see bandwidth effects. Once you do this, I expect that things will start working as you expect them to.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
loose-electron
Senior Fellow
******
Offline

Best Design Tool =
Capable Designers

Posts: 1638
San Diego California
Re: need help in designing a comparator with hysteresis
Reply #2 - Mar 22nd, 2010, 2:44pm
 
Ken has some good points -- also -- typical hysteresis circuit is 3 resistors - 2 set the Vref and one (usually much bigger in size) feeds back the positive hysteresis value.

I would get something working without the feedback, and then add that in after-wards.
Back to top
 
 

Jerry Twomey
www.effectiveelectrons.com
Read My Electronic Design Column Here
Contract IC-PCB-System Design - Analog, Mixed Signal, RF & Medical
View Profile WWW   IP Logged
Prof78
New Member
*
Offline



Posts: 2
Manchester, UK
Re: need help in designing a comparator with hysteresis
Reply #3 - Jan 5th, 2011, 4:57am
 
There seems to be a basic misunderstanding of the effect of positive feedback on the operation of this circuit. Applying positive feedback increases the gain of the system and any significant amount can make the gain greater than infinity. The result of this is that the output will be driven to either limiting value, close to the supply voltages. Thus assuming supplies of +/-15V the output will be at one or other of these depending on the previous input history. Since the output is in a saturated state the gain will be very low and these two states will be stable. Thus the stated result that the system appears to act as an amplifier of gain 3 is simply a function of the supply voltages relative to the applied input. For an extended discussion of the operation of the circuit see the book An Analog Electronics Companion, (Cambridge University Press, ISBN  9780521687805, p252-255). My LM324 datasheet does not include the formula quoted in the post but I think the terms Voh and Vol are not the desired output voltages as assumed (i.e. 2V) but the limiting voltages as outlined above i.e. ~ +/-15V. To obtain the desired +/-2V output swing additional limiting will be required. Inputting a square wave as shown in the circuit diagram is not useful in showing the hysteresis and switching points; use a triangle or sin wave and you will be able to see the input switching levels and hence find the hysteresis. The use of such low value feedback resistors will mean the opamp output must supply a substantial current.
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.