Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Looking for compartor circuit with independent threshold adjustments

Status
Not open for further replies.
We have only been discussing one portion of the circuit. The section that I have believed is causing the issue. Here is the entire circuit.

Diode Hystersis 1.jpg
 
There is no reference for the comparator. You need to set the reference in the center where you want it to switch and then use the hysteresis to adjust it.
 

Attachments

  • comp3.png
    comp3.png
    137.2 KB · Views: 133
I knew something looked wrong. I moved that opamp buffer 2 or 3 times. Turns out it was supposed to be Vref and I forgot the input stage.

Diode Hystersis 2.jpg
 
Now you just need a resistor between the ref. output and the input of the comparator so the hysteresis can move it around.
 
The only other thing I can think of now that might give you trouble is that if your power supply has ripple that is higher than the hysteresis you want it might chatter at the ripple frequency. But if you have much hysteresis at all it should be ok.
 
My target is about 0.5V hysteresis with Vref around 7V. I'm thinking the voltage(s) required to forward bias the resistors are somehow an issue. I'm using 1N914 diodes, the DVM says 300-400mV Vf drop. With Vin increasing, the chatter starts at VthLow and ends at VthHi. Based on my last circuit which diode is for VthLo and VthHi? I think D1 for Lo and D2 for Hi.

I have changed the power supply from prototype to final install. I will reconnect to the bench supply and see if I get the same result. I believe the bench supply is a Power One, the final install supply is one of these **broken link removed**. (spec sheet show 120mV ripple on the +12V supply)

Since I'm slow close I'd like to figure out what is wrong. I'll put this one into service while I concoct version 2. But I'm sensing a version two coming. I would really like to be able to set the thresholds independent of the state of the output. This circuit does not allow me to do that.
 
Last edited:
Now you have a problem. Since the output never goes above 6.65 volts you can't adjust the upper threshold high enough. If you change the transistor to a FET like a little 2N7002 you will get the full voltage swing at the output. Short of that you would need to divide the input down.
 

Attachments

  • comp thres.png
    comp thres.png
    168.2 KB · Views: 125
I lied. :eek::eek: You can bias up the reference like this:

The FET would be better for temperature and stuff like that, but this should work.
 

Attachments

  • comp thres1.png
    comp thres1.png
    163.9 KB · Views: 118
With the optocoupler in the output (per the schematic in post #27), LM393 Pin 1 output goes to just over 11 volts and as low as 0.4V (pullup current ~5mA, pullup R=2.2k). But the problem still exists. The relay chatters when VthLo < Vin <VthHi.
 
I think the first problem was the real one. But if there are different outputs you will need different sets of values for the 2 comparators since that voltage is in the feedback path. Try it with just the relay side and see how that works then it might be time to make them symmetrical.
 
I don't understand. The only change I have made is the optocoupler. Is that the 'first problem' to which you refer?

Why do I need two sets of values for the comparators? I have been using this configuration for years. They are not supposed to be symmetrical but inverted. Note the inputs are swapped, so the outputs are opposite polarities which allows the bicolor two-pin led to work. Since there is no feedback on the relay comparator and the inputs are VERY high impedence, having the second input tied into the same feedback/hysteresis circuit should not have any impact.

FWIW, I placed the DVM on ACV and hooked it to the final power supply and it display 50mV. Leads shorted it reads 2mV. If I attach it to the output when the relay is chattering, it display ~4.8V.

I removed one diode, and shorted the other and could not get the output to chatter. I think there is problem lies in the range where the input is crossing over the region where the diode bias is changing.
 
Lets just stick to the one with the relay first. Does that look like post 31? What are the values.
 
No. It looks like post #27. R6, 7, 9, and 10 are 1K, R11 and 12 are 1.5k. According to the AC V setting, both outputs chatter which makes sense as both comparators are connected to the same thresholds. But as the relay circuit is not connected to the feedback circuit, where are you heading?

Since reconnecting the feedback circuit to the other comparator would be VERY difficult. So I'll disconnect R7 from R6 and connect it to R8, but I highly doubt it will make any difference.

Update: No difference. I moved R7 from R6 to R8 and floated the inputs to the second comparator. It doesn't matter if R7 is connected to R6 or R8. When Vin is between VthLo and VthHi, the relay, LED, and output chatter. If I have time and they have one in stock, I will get another optocoupler tomorrow. I will wire the LED in series with the first and reduce the pull-up resistor slightly to maintain 5mA. I will set up the output of the second optocoupler inverted to the one that is already there. Then I can do away with the other comparator. It will simplify the circuit, but I doubt it will solve the problem.
 
Last edited:
How about r2, r3 and r16?

I'm just trying to simplify things till we can figure out what is going on. It is fairly easy for me to simulate it if we have all the values.
 
R16 is 1K, R2 is a 20k pot, R3 is a 10k pot, R4 is 3.3k. VthLo is around 6.5V, VthHi is around 7.5V.

I'm still hung up on the fact it only does it with the diodes.
 
Alternate configuration for comparator with individual thresholds

I deleted this post because two designs were merged into one thread confusing the thought and design process. I will repost after this design concept is finished.

Mod merged it. I deleted it.

[This Thread was Merged, Do NOT delete Moderation text.]
 
Last edited:
OK. I'll plug it in in a while-got some honey do's. If it works with just a resistor try say a 470k across the diode/pot combination. I guess it could be where neither diode is conducting. That would give it enough to settle it down.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top