Help with comparator design

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
trident
Posts: 23
Joined: Wed Aug 20, 2008 3:30 pm
Location: Indiana, USA
Contact:

Post by trident » Tue Jan 13, 2009 4:11 pm

Hello to All

The fan control is single loop, when the temperature increases above threshold the software I am using, SpeedFan, increases the speed command to the fan. It does not check to see if fan speed increased. SpeedFan waits a time interval and checks the temperature again and adjusts the speed command according to the temperature. The tachometer signal to the motherboard is only to verify that the fan is running, If the motherboard does not see a tach signal it triggers an alarm. In reviewing the data sheet for the LM4040 I discovered it has a turn-on time of 10 microseconds so it is miss applied in the first schematic. I have successfully used the low-pass filter and three transistor amp to control a fan from the motherboard. I could use a trim-pot in the feedback divider and be done with it, but I have concerns about drift from thermo-cycling and needing to periodically readjust the potentiometer. Would a sealed Cermet trimmer be suitable? At the present, I would like to work on refining the input section. The intended operation as follows: R2 and R3 divide the input signal so Q1 turns on when the input is more than approximately 0.9 volts. R1 with R2 and R3 pulls-up the input to approximately 2 volts. R4 is to compensate for leakage current through Q1 and keep Q2 off when Q1 is off. R3 is guesstimated to be the largest value I can use to minimize current draw and still have reliable switching. R6 and R7 are a compromise to minimize current draw and the gain required in the output section. R8 and C1 form a low-pass, 100K being the largest value I can use without excessive resistor noise. R9 limits current to the LM4040 to a little less than 6mA, approximately seven times the expected current draw of the input section. Would some bulk capacitance be helpful for the LM4040, say a 4.7uF tantalum? For this project minimal size, stability and minimal drift are more important to me than the best possible linearity. Your comments welcome.

Regards
trident
Image

sghioto
Posts: 321
Joined: Wed Dec 26, 2007 5:16 pm
Location: Colorado
Contact:

Post by sghioto » Tue Jan 13, 2009 5:24 pm

trident,

Seems like the specs keep changing as this is developing. So you have a working output circuit that needs a 0 to 3 volt input. Again, why not use a buffer amp for the input circuit, in this case a dual buffer. Eliminate all the resistors and transistors. The 3.3 volt regulator will set the amplitude of the PWM signal.

Steve G.



Image

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Post by Bigglez » Tue Jan 13, 2009 11:24 pm

sghioto wrote:Again, why not use a buffer amp for the input circuit, in this case a dual buffer. Eliminate all the resistors and transistors. The 3.3 volt regulator will set the amplitude of the PWM signal.
Nice!

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Wed Jan 14, 2009 12:05 am

A cheap LM393 is a good alternative as i was saying.
It should be fast enough to handle 25kHz with decent
rise and fall times.
LEDs vs Bulbs, LEDs are winning.

User avatar
Bob Scott
Posts: 1192
Joined: Wed Nov 20, 2002 1:01 am
Location: Vancouver, BC
Contact:

Post by Bob Scott » Wed Jan 14, 2009 11:05 am

Bigglez wrote:
trident wrote:The fan in question behaves very well with variable DC, weather(sic).......
To get a DC average from the PWM signal an intergrator(sic)......

Once you have a clean signal from the front end of your
circuit you can apply this to an intergrator(sic).....
What's an "intergrator" Bigglez? Some kind of cheese processor?
You know what they say about people in glass houses..

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Post by Bigglez » Wed Jan 14, 2009 11:08 am

Bob Scott wrote:
Bigglez wrote:
trident wrote:The fan in question behaves very well with variable DC, weather(sic).......
To get a DC average from the PWM signal an intergrator(sic)......

Once you have a clean signal from the front end of your
circuit you can apply this to an intergrator(sic).....
What's an "intergrator" Bigglez? Some kind of cheese processor?
You know what they say about people in glass houses..
A typo... Sorry that I did that, I'll proof read my
future posts to the same standards as you do.

trident
Posts: 23
Joined: Wed Aug 20, 2008 3:30 pm
Location: Indiana, USA
Contact:

Post by trident » Thu Jan 15, 2009 10:43 am

Hello sghioto

I concur with Bigglez, very elegant solution.
Correct me if I am misunderstanding. The AD822 you suggest has a slew of 3 volts per microsecond. With positive logic PWM, a 25 KHz square wave of 30% duty cycle would have a pulse width of 12 microseconds and a space width of 28 microseconds. For a 3 volt swing, rise time for the AD822 would be less than 10% of the pulse width, and that would provide minimal distortion. Using a gain of 4.0, this should give plenty leeway for a final output of 5 to 12 volts. In addition, by using a IC-zener I would have minimal thermal drift. Do you have a suggestion as to one that would be any better than an LM4040C30? As MrAl suggested This could also be implemented with an LM393. Thank you to all for your time and effort. Your insight much appreciated.

Regards
trident

sghioto
Posts: 321
Joined: Wed Dec 26, 2007 5:16 pm
Location: Colorado
Contact:

Post by sghioto » Thu Jan 15, 2009 5:38 pm

Thanks Bigglez and trident,

That is all correct. The LM4040C30 is fine with me. BTW this circuit has been breadboarded using the AD822 op-amp and the LM393 comparator.
Outputs are pretty much identical showing about the same amount of slew time or distortion. I have also configured the circuit using the first half of the AD822 as a comparator with similiar results.
I still prefer the AD822 used as a dual buffer in this application though, less components and "cleaner" in my opinion.

Steve G.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Thu Jan 15, 2009 7:59 pm

Hi again,


Im not sure the point about the LM393 got through yet. It can be
used for the comparator section as well as the op amp section.
In other words, one half is used as comparator and the other half
is used as op amp. The configuration is almost the same as the
original drawing.
LEDs vs Bulbs, LEDs are winning.

trident
Posts: 23
Joined: Wed Aug 20, 2008 3:30 pm
Location: Indiana, USA
Contact:

Post by trident » Fri Jan 16, 2009 6:23 pm

Hello everyone

MrAl is this what you envisioned for the LM393 configuration? I have changed the threshold to 1.0 volts and reduced the hysteresis, from the original circuit. C2 was added per the data sheet. As I explained before, the LM4040 has a turn-on time of 10 microseconds and was misapplied in the original circuit.
Image

This is the test amplifier I have on breadboard.
Image

And this is the amp with the dual buffer sghioto designed
Image

Regards
trident

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Jan 16, 2009 9:26 pm

Hi Trident,


Yes, that is something like i was thinking too.
The resistor R22 can come down in value quite a bit however,
and have to add a small cap across R5 (like 0.01uf).
I dont know if you really want to run R1 up to +12v either.
Maybe a voltage divider would help there.

The transistor circuit might work too, but it may be a little
dependent on the logic low level of the input because it's
not buffered first.

Here is another transistor version that does not need a buffer.
Note the use of an NMOS and that the fan motor is connected
with common to Vcc instead of ground.
Also note that a resistive divider R1 and R2 is used instead of
a pullup to +3.3v. This only works if the +12v supply is relatively
stable.



Image
LEDs vs Bulbs, LEDs are winning.

trident
Posts: 23
Joined: Wed Aug 20, 2008 3:30 pm
Location: Indiana, USA
Contact:

Post by trident » Sat Jan 24, 2009 4:21 pm

Hello

I occurs to me that I did not see the forest for the trees. I redrew the circuit including the motherboard and realized that the amplifier is sourcing current to the motherboard. Insert Homer Simpson d'oh! I believe what needs to be optimized is the low-pass filter and the pull-up resistor. Considering that the impedance at the base of Q1 is several meg ohms, is 100K ohms an appropriate value for R2? If so, than the motherboard would sink less than 100 micro amps and the pull-up resistor should be considerably larger than 10K ohms value I originally used when testing the amplifier.

Regards
trident



Image

sghioto
Posts: 321
Joined: Wed Dec 26, 2007 5:16 pm
Location: Colorado
Contact:

Post by sghioto » Sun Jan 25, 2009 8:06 am

trident,

100K is fine for R2. I would set R1 no larger then 10K. The only current the MB sees is through R1, 330 micro amps at 10K.

Steve G.

trident
Posts: 23
Joined: Wed Aug 20, 2008 3:30 pm
Location: Indiana, USA
Contact:

Re: Help with comparator design

Post by trident » Mon Feb 16, 2009 12:22 pm

Image

After putting this project aside for some other priorities, I stumbled on to a data sheet for the LM392 amplifier/comparator dual. This got me thinking about the limitations of the discrete transistor circuit. A comparator input can give better noise immunity, also I would like to set a minimum output of 5 volts. Would splitting the comparator pull-up resistor as shown be practical? Is the LM392 unique, are there other amplifier/comparator duals with better specs?
As always, your comments and suggestions appreciated.

Best regards,
trident

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: Help with comparator design

Post by Bigglez » Mon Feb 16, 2009 6:15 pm

trident wrote: As always, your comments and suggestions appreciated.
What is the purpose of R7? 100k in series with a FET gate
seems a bit high. Did you mean 100 ohms?

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests