Comparator With Hysteresis Issues, Acting With no Hysteresis  - Page 1
Forum section: electronics / projects

author: canemichael97
author_rank: Newbie
timestamp: June 16, 2023, 08:45:39 am
content: Hi all,i am currently designing a low voltage disconnect module for a 24V battery system. The comparator should function by disconnecting the supply via a mosfet when the supply reaches approx. 21.7V and reconnects when the supply raises to 22.98V. The circuit is utilising a 10V reference voltage the supply is divided down by a factor of 3 to the inverting comparator input. The reference passes through a divider and positive feedback resistor to get the varying set point trigger. The comparator output drives the gate of a PMOS FET via a couple of transistors to disconnect the supply from the main circuitry.The circuit has been simulated in LTSPICE and behaves as expected. However, after getting this laid out the comparator actually appears to disconnect the supply at around 16V with no hysteresis. Any tips on what i should be looking for or feedback on the attached circuit block to help resolve the issue?Thanks!!Mike

author: Slh
author_rank: Regular Contributor
timestamp: June 16, 2023, 09:21:27 am
content: I don't have the specific reason why it's not working but I do have a bunch of questions.1) why are you using such an expensive opamp as a comparator? Seems like a waste.2) it's not a particularly high gain opamp. Looks like you're set for a gain of around 60dB(?) for the hysteresis. Gain at 100Hz is only 30dB in the datasheet and it doesn't tell you much more than that.The bias currents through the 1M6 resistor might be messing with the expected hysteresis. I haven't checked how much you're expecting hysteresis to be at the V+ and V- nodes but it might be close to the input bias current X 1M6.

author: canemichael97
author_rank: Newbie
timestamp: June 16, 2023, 09:41:33 am
content: Thanks for your response!To answer the question regarding the opamp, the system this will go in is battery powered and this circuit block will be used to disconnect the load when hitting the low threshold. The batteries are rechargeable cells and so the aim is to keep any current draw as low as possible as there is no guarantee that the batteries can get attached to a charger quickly once the cutoff has triggered. The opamp was selected foe its extremely low supply current.Interesting point raised regarding currents through the 1M6, will look into that!Thanks!

author: KerimF
author_rank: Frequent Contributor
timestamp: June 16, 2023, 10:11:19 am
content: Quote from: canemichael97 on June 16, 2023, 09:41:33 amI guess you know that the current of R20 (1K) is relatively very high 'always'. Replacing it with 100K won't affect the drive of P-MOSFET.

author: canemichael97
author_rank: Newbie
timestamp: June 16, 2023, 10:23:11 am
content: Yes that was spotted after going out to manufacture but the board has already been modified to move this over to a 10k to match R21. After further testing we will likely move both of these to 100k.Thanks!

author: ArdWar
author_rank: Frequent Contributor
timestamp: June 16, 2023, 10:30:32 am
content: I bet you can actually get lower power consumption using actual open drain comparator instead of allowing opamp to saturate its output. You can even save on the gate drive transistor cascade.

author: Warhawk
author_rank: Frequent Contributor
timestamp: June 16, 2023, 10:31:32 am
content: Never use an opampas a comparator unless the datasheet specifically says that it can operate open-loop. Internal structures are way more advanced than it used to be 30 years ago. The opamp may exhibit excessive current draw, output glitches, reversals, reduced lifetime, etc.

author: Peabody
author_rank: Super Contributor
timestamp: June 16, 2023, 02:12:27 pm
content: The real opamp will have input offset voltage of some amount per the datasheet. But the simulated opamp probably doesn't unless you provide it. Could that explain why it works only in simulation?Also, when you switch off the battery, won't its voltage recover somewhat? If hysteresis is too small, it will oscillate.

author: Infraviolet
author_rank: Super Contributor
timestamp: June 16, 2023, 06:20:39 pm
content: That general topology of:..inverting input to analog input signal..non-inverting input to voltage divider and through a resistor to the outputIs one I have found to work with rail-to-rail op amps (spares within an MCP6024 quad package already on a board) at low voltages.Have you checked what the voltages occuring at all points in the circuit are when the input is rising or falling across your thresholds?Part of me also wonders if somewhat smaller resistors, while keeping whatever ratios you calculated as correct, might help?I used the following for calculations for my hysteresis comparator use of op amps:Vutp=Vin * ( R/ ( R + (1 / ( (1/R) + (1/R) ) ) ) )Vltp=Vin * ( ( 1/( (1/R) +(1/R) ) ) / ( R + 1/( (1/R) +(1/R) ) ) )Vin=op-amp supply, Vltp and Vutp and lower and upepr thresholds, R is from non-inv input to op-amp supply, R is from non-inv input to ground, R is from non-inv input to output.You are not running in a high speed situation here, so the relative slowness of op amps compared to comparators looks tolerable.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 16, 2023, 07:33:33 pm
content: Have you checked that all mounted resistors were the correct value?

author: canemichael97
author_rank: Newbie
timestamp: June 19, 2023, 01:01:57 pm
content: Thanks all for the responses. To avoid issues with the op-amp i have swapped this out for a dedicated micro-power comparator (TLV3401) and after some minor tuning of the resistors everything is behaving!