Op-amp hysteresis problem - Page 1
Forum section: electronics / projects

author: Siddhat
author_rank: Regular Contributor
timestamp: July 09, 2020, 05:35:49 am
content: Hey guys! Namaste.The schematic attached implements hysteresis on a LM358 comparator IC. The circuit was designed following the guidelines from texas instruments. The upper threshold and lower threshold volatges were set to 2.4V and 2.3V respectively with Vcc 5V. The inverting input actually varies due to charging and discharging from a lead-acid battery whose voltage is scaled down using a voltage divider. A positive feedback hysteresis resistor was connected between the non-inverting input and the output. The output is connected to the base of a transistor which drives a realy.The problem is: while the battery is being charged i.e. while the voltage at the inverting input increases and the upper threshold of 2.4V is set at the non-inverting input which is okay. But while the battery is discharging i.e. when the voltage is decreasing, the lower threshold is not set to 2.3V but a bit higher at about 2.33 volts. How can this problem be solved? and how can the upper and lower thresholds be set perfectly?

author: Siddhat
author_rank: Regular Contributor
timestamp: July 09, 2020, 05:39:22 am
content: This is the designed schematic!

author: magic
author_rank: Super Contributor
timestamp: July 09, 2020, 06:39:48 am
content: This circuit works for a dedicated comparator IC with open collector output. LM358 is an opamp, put R3 between the output pin and the transistor's base instead.Then re-do the hysteresis calculations taking into account that the output of the chip will swing:- between 0V and 0.7V if you use a real comparator with R3 connected as is- between 0V and maybe 3V if you use an LM358 with R3 moved as above

author: Vovk_Z
author_rank: Super Contributor
timestamp: July 09, 2020, 10:45:35 am
content: You need to increase R11 (positive feedback) to decrease hysteresis (if a problem is with hysteresis width). You may use a tuning resistor somevere betweem R7, R8 (or potentiometer) to adjust threshold value.And yes - R3 is for real comparator IC with open collector output like LM393/LM2903 (can be used here).

author: Siddhat
author_rank: Regular Contributor
timestamp: July 09, 2020, 05:01:15 pm
content: First of all I suspected the hysteresis width to be small of only 0.1V and tried increasing the width in search of better performance. I tried setting the upper and lower threshold voltages to 3.6 and 3.45 Volts respectively which is equivalent to battery being fully charged at 14.4 Volts and discharged at 13.8 Volts. But the problems still persisted. If the voltage is rising from 3.45 Volts, the op-amp's output changed before the voltage reached 3.6 Volts at around 3.55 volts. And while the voltage was decreasing from 3.55 volts, the op-amp's output changed before the voltage reached 3.45 volts at around 3.5 volts. The same problem persisted with the upper and the lower thresholds at 2.4 and 2.3 volts respectively.Really stuck on this one!

author: Vovk_Z
author_rank: Super Contributor
timestamp: July 09, 2020, 08:57:23 pm
content: 3.55 V instead of 3.6 V is not bad. Sorry, I don't get what a problem is? (may be I'm tired a little...)

author: Siddhat
author_rank: Regular Contributor
timestamp: July 10, 2020, 04:17:05 pm
content: Quote from: Vovk_Z on July 09, 2020, 08:57:23 pmThe problem is I do not get a hysteresis at all. The lower threshold increases to a much higher value as soon as the voltage at the inverting terminal decreases and the upper threshold starts to decrease as soon as the voltage increases. And therefore, there is no hysteresis. As far as I know the LTP and the UTP should remain the same when the voltage at the other terminal increases or decreases There should have been a hysteresis according to the calculations.