Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Comparator circuit problem.

Status
Not open for further replies.

David_

Advanced Member level 2
Joined
Dec 6, 2013
Messages
573
Helped
8
Reputation
16
Reaction score
8
Trophy points
1,308
Location
Sweden
Activity points
12,222
Hello.

I've got a circuit that I can't figure out a solution for, its a part of a current sense/limit circuit.
A current sense amplifier produces a voltage between 0-1,5V and that voltage is being compared with a LM311 to a 0-1,5V from a DAC that is used to set the limit, when the current sense voltage rises over the DAC voltage the comparator output switches to high and pulls a power supply voltage rail down to 0V(or 32mV). Provided hysteresis does so when the sense voltage goes above the DAC voltage it has to be lowered 0,1V below the DAC voltage(exact value will be determined later).

However, when the current is low there are a scenario where the sense voltage can trip the comparator and then go back to 0V without switching the comparator back to low output. the way to resolve this would then be to increase the DAC voltage until the comp switches back. Not really convenient.

Does someone have any suggestion?
comp.eda.png
 

Not quite sure what your question is. If you have, say, 50mV of hysteresis, then your input HAS to swing greater 50 mV around the trip point. That's just the way it works. You can't expect to have 50 mV of hysteresis, and then have a trip point of 25mV.

What is the exact 'scenario' where you see this problem? What are the voltages? I would suggest you decrease your hysteresis.
 

May be hysteresis is too large. Try a larger value for R3HYST .

And block the non-inverting input (2) with a capacitor to GND, in order to decrease input spikes from current sensor.
 

I am running a simulation with multisim, the comparator(comp) is connected as the schematic with one Interactive DC voltage source to each input.
The DAC or set voltage is at 0,1V(at the inverting input), 0,1V translates to ~166mA.

Then I increase the voltage at the non-inverting input, representing the current sense voltage.
When the sense voltage is at 0,1V the comp output is low as I'd like it to be, when the sense voltage goes over 0,1V the comp output switches to high to pull a rail down to 0V.

Then I decrease the sense voltage to 0V, but the hysteresis causes the comp output to be maintained high until the DAC voltage is increased.
Which in my application is a really bad effect, I have read for hours about hysteresis but I find it very hard to get a grip of. The hysteresis in my circuit is not something that I theoretically deduced and then implemented but rather just tested to get it right, so I do understand that this reaction is expected but I can't figure out how to make a circuit to do what I want.

The sense circuit can sense down to 1mA(although at that level there are some major error margins to take into account, 1mA might be with a 50%+ error) but at 10mA the voltage would be about 4mV. I see now that the way of detecting those levels will not be possible with my current circuit, no?
Do somebody have any idea where I might begin to produce a circuit capable of this application?

- - - Updated - - -

The thing is also that(as I was informed about) that I need to watch out for oscillations at the output, oscillations would cause a lab power supply output to oscillate to. I have seen circuits that do very much what I'd like mine to do but they use a op-amp with a capacitor from the output to a input, but that current sense voltage is centered around 2,5V and I don't think that a circuit like that could achieve the small current accuracy that I'd like mine to have(but what do I know).
If its possible with the means at my disposal I'd Seattle for the capability to detect and limit a minimum current of 10mA, that's 4mV.

I'm really lost here.

- - - Updated - - -

The voltage is produced by a LT6105 and buffered with a precision, auto-zeroing, zero drift op-amp.
The limit function is as follows:
A adjustable voltage regulator is adjusted through a resistor voltage divider, a resistor from the output to the feedback pin and a resistor from the feedback to ground. To the feedback pin junction there is another resistor connected to a voltage output DAC that produces between 0 and 4,5V, at 0V the regulator output is at max and at 4,5V the regulator output is at 0V or 32mV.

From the comp output there goes a 1N4148 diode to a resistor that connect to the feedback pin junction, so as to force the regulator output to 0V when the comp is high(high output is 5V) just as if the DAC would have produced 4,5V.

The comp output just needs to go high so it all depends on the sensitivity of the circuit that switches from low to high, it doesn't need to be a comparator if anyone have any other suggestions?
 

Your circuit has about 100mV of hysteresis which explains why it's working as it does. IT'S WORKING EXACTLY AS DESIGNED!

You have to lower your hysteresis.

If you expect to trip at 1ma (which I assume corresponds to 600 Microvolts) you need to have a hysteresis less than that. If you are concerned about oscillations (rightly so) you could try placing a small cap across the inputs of the comparator-that often helps.
 

I might have made my self unclear but yes I know it does work exactly as designed, I guess I question that I can achieve the small trip voltage and still have hysteresis enough to stop oscillations. When I understood how it worked and that it works as it should I begun questioning that this is the most suitable solution, I would like to use some newer comparator but the no ones that drew my eye at first could handle 0V input.
Or have I understood right that when it says that the common-mode input voltage range goes from V-(+50mV) to V+ that in a single supply operation the minimum input voltage should not be lower than 50mV?
If so what would happen if one would to violate that?
But this is a first for my in this kind of circuit and I will produce the circuit as it is with a small cap, I have had a situation where I can't ether produce or test circuits which is really designing in the dark. Simulations seldom gives me result I really trust because before the end of the simulation there has appeared such weird things that I don't know if I am designing wrong or if the simulator is wrong, some of the times I know for sure that the simulator i whop-dido in its deduction.

Simulators always has the potential of giving wrong results but if I where to ask you to name a analog/digital simulator off hand do you have any to suggest that's worth getting into?

Oh yea I forgot, I know have the ability again to start producing circuits and within not to long a time I will have access to my equipment again, so I can start learning for real again and see for my self what this circuit for one will do in action.

I find my self wondering about what is the most suitable choice in this application, a newer comparator with a low offset voltage or one like LM311 and trim the offset with a pot. Any thoughts?
 

So many questions!

Yes, if the spec says the common-mode range is minimum V-(+50mV) that means that is the minimum input voltage over which the device will work. You won't damage the part if you go below that voltage, but it probably won't be able to sense it properly.

What is the speed of your input signal? Comparators have the most trouble, as far as oscillation, with slowly changing signals. What causes the oscillation is the fact that there is ALWAYS a little bit of noise riding on your signal, so that when it reaches the trip point, the input is actually bouncing above and below the trip point, and the fact that the comparator is a very high gain device. That's why the hysteresis helps. You need to characterize your input signal. Can you add more filtering to it?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top