• 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.

Need help increasing hysterisis for comparator circuit

Status
Not open for further replies.

1abeng

New Member
This circuit determines which voltage supply to switch to the motor - solar panel (SUN+) or power supply (24V+). My comparator circuit is toggling on/off when the +V IN is near the -V IN (6.5V). It cycles very fast.

Can anyone give advice on preventing the toggle? Circuit is attached.

Thanks in advance
 

Attachments

Chippie

Member
Looks to me like there's no feedback around the controlling comparator... U4.1, but I could be wrong..

See the attached sketch
 

Attachments

Last edited:

1abeng

New Member
I can't claim the design. It is a prototype product for me. I tried a few feedback options but I don't know enough to select the right components or put them in the right place.
 

ericgibbs

Well-Known Member
Most Helpful Member
This circuit determines which voltage supply to switch to the motor - solar panel (SUN+) or power supply (24V+). My comparator circuit is toggling on/off when the +V IN is near the -V IN (6.5V). It cycles very fast.

Can anyone give advice on preventing the toggle? Circuit is attached.

Thanks in advance
hi,
Usually adding a resistor between pins 1 and 3 of the comparator will add hysteresis.
Start with a high value, say 470K,, the lower the value the greater the 'dead band'.

EDIT: if you do add hysteresis you may have to readjust the SUN on/off points!!
 
Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
hi 1ab,
This are the results from a LTspice simulation.

The results dont agree with what you say on the circuit diagram.???

Check thru this LTS circuit, the caps have been omitted for clarity.

What colour is the LED 'D2' on my circuit.???
 

Attachments

Last edited:

1abeng

New Member
Thank you for your review! The D2 color is green, D1 is Yellow. The Vsun doesn't react the same as the simulation. As soon as the load is removed, the voltage shoots up past the upper threshold but it can't generate the current to keep it above the bottom threshold when it switches back. I connected a resistor (180ohm/5W) across the +Vsun and -Vsun when not in SUN mode (same trigger as relay K1) to keep the voltage down but it required a delay-on-release relay (50ms) to work. There must be a better way.

Thanks again.
 

BrownOut

Banned
hi 1ab,
This are the results from a LTspice simulation.

The results dont agree with what you say on the circuit diagram.???

Check thru this LTS circuit, the caps have been omitted for clarity.

What colour is the LED 'D2' on my circuit.???

I thought it was U1 that needed the feedback?!?!

EDIT: Ok, I see where the hysteresis is coming from now. Never saw it done that way before. Duh!
 
Last edited:

MrAl

Well-Known Member
Most Helpful Member
Hi,

The placement of C23 is part of the problem because it prevents the
snap action of the hysteresis from working properly. The design should
be changed to eliminate this cap or to modify the hysteresis feedback.

One way might be to place the hysteresis resistor (of the right value)
between pins 1 and 3 and let the LED section go without any hysteresis.
This way the cap C23 can be left there for a little filtering.
You also need to add some resistance between pin 3 and the two
caps connected to that pin so the hysteresis works properly.
 
Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
Thank you for your review! The D2 color is green, D1 is Yellow. The Vsun doesn't react the same as the simulation. As soon as the load is removed, the voltage shoots up past the upper threshold but it can't generate the current to keep it above the bottom threshold when it switches back. I connected a resistor (180ohm/5W) across the +Vsun and -Vsun when not in SUN mode (same trigger as relay K1) to keep the voltage down but it required a delay-on-release relay (50ms) to work. There must be a better way.

Thanks again.
hi,
The point I noted was the switching points, the sim makes these 4V and 10V.!

The voltages marked on the circuit marked at point Vr dont agree with the sim.

EDIT:

I'll re-run sims with C4, also introduce the offload jump OK, let you know the result.

BTW: making D2 a green LED, changes the limits to 4V and 11V
 
Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
I thought it was U1 that needed the feedback?!?!
hi,
The circuit uses the upper LM393 to provide the hysteresis for the first LM393.

The range is +4V and +10V according to the LTS sim,
 
Last edited:

BrownOut

Banned
hi,
The circuit uses the upper LM393 to provide the hysteresis for the first LM393.

The range is +4V and +10V according to the LTS sim,
Right! Took me a moment to realize that. Never saw it done that way before.
 
Last edited:

1abeng

New Member
I'm not sure what the difference is. The actual circuit switches at 4.5V and 13.1V.

Hi,

The placement of C23 is part of the problem because it prevents the
snap action of the hysteresis from working properly. The design should
be changed to eliminate this cap or to modify the hysteresis feedback.

One way might be to place the hysteresis resistor (of the right value)
between pins 1 and 3 and let the LED section go without any hysteresis.
This way the cap C23 can be left there for a little filtering.
You also need to add some resistance between pin 3 and the two
caps connected to that pin so the hysteresis works properly.
MrAI, Are you talking about moving R29 to U4.1 pins 1 and 3 then adding R31 between pin 3 and C21 / C22? What value is needed for R31?

FYI - the circuit reacts very differently on the solar panel than on a power supply simulating the panel by restricting the current. The cycling is very fast when on the panel partially covered.
 

ericgibbs

Well-Known Member
Most Helpful Member
hi 1ab,
With the high jump in SUN voltage when going off load, the circuit is definitely unstable when running in simulation.!

I'll see if I can suggest any changes,, it will be tomorrow OK.:)
 

Attachments

Last edited:

1abeng

New Member
A 220KOhm resistor accross U4.1 pins 1 and 3 didn't make much difference. It may have slowed the cycling a little. I have limited resistor values to test.


If this works, what are the pros and cons of doing this:
I connected a resistor (180ohm/5W) across the +Vsun and -Vsun when not in SUN mode (same trigger as relay K1) to keep the voltage down but it required a delay-on-release relay (50ms) to work.
 
Last edited:

MrAl

Well-Known Member
Most Helpful Member
Hi,


That instability is due to the capacitor as mentioned earlier.
Remove that cap and the problem goes away, but in real life some
filtering is a good idea so maybe just place a small value resistor
in series with the voltage tap and place the cap across the voltage
tap.
Before i could draw up a circuit, i would need to know what the turn on and
turn off points need to be.

Here is a circuit with a quick fix, although the value of the lower resistor
for the voltage divider would have to be adjusted to make up for the
added 10K resistor (which aids the hysteresis).
 

Attachments

Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
hi Al,

The problem is when the comparator/relay switches the motor load from solar 'SUN' voltage to the 24V external supply, [at the low SUN limit of 4V], the offload voltage of the solar panel jumps up to about 17V.

This 17V jump causes the comp to switch the relay back to the SUN voltage source, as it exceeds the high limit voltage of 14V, which as soon as it goes on onload drops to about 4V! again.

Basically the circuit design is unstable.

I have run a number of sims in LTspice which highlight the problem.

Regards
 
Last edited:

BrownOut

Banned
I was thinking the same thing, but for some reason, didn't get around to posting.

Eric, you really go above and beyond when it comes to helping :)
 

MrAl

Well-Known Member
Most Helpful Member
hi Al,

The problem is when the comparator/relay switches the motor load from solar 'SUN' voltage to the 24V external supply, [at the low SUN limit of 4V], the offload voltage of the solar panel jumps up to about 17V.

This 17V jump causes the comp to switch the relay back to the SUN voltage source, as it exceeds the high limit voltage of 14V, which as soon as it goes on onload drops to about 4V! again.

Basically the circuit design is unstable.

I have run a number of sims in LTspice which highlight the problem.

Regards
Hello there,


Ok, i was assuming all the simple ground work had already been done
and based my assumption partly on your simulation, which shows the
problem with that cap. Note that whatever system is used, if that
circuit is to be used for anything some mods need to be done.

All i can suggest at this point is that the OP post the entire setup
the way it is wired to all the devices in the system. This way we can
make a better assessment of the situation and recommend a good
circuit to achieve the desired goals.

Overall it was an interesting circuit in itself, but i just feel that
another approach altogether would be a good idea anyway.



Here's the sim i based my circuit on:
 

Attachments

Last edited:

ericgibbs

Well-Known Member
Most Helpful Member
hi Al,

I agree, the circuit needs to be reworked, based on the complete project.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top