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.
User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Re: Help with comparator design

Post by MrAl » Tue Feb 17, 2009 7:39 am

Hi again,


100k is ok for this circuit because the MOSFET is being driven in its linear region.
100 ohms would be more typical for a switching circuit that has to respond fast
in order to keep power dissipation down low. For a linear circuit it is known
beforehand that power dissipation wont be that kind of issue.

There is a concern however in that an op amp instead of another comparator
is being used to drive the output Q1 MOSFET. Another comparator would have
its output pulled up to +12v and so it is certain that the output of that comparator
would be able to reach very very near to +12v. With an op amp like the one
shown in the schematic (1/2 of LM392) the output will not be able to reach
+12v because the output stage of the op amp is internally constructed a bit
different than the comparator and so it will be limited to 12-1.5 or 10.5v output.
Unfortunately, this may not play well with the chosen MOSFET because that
has a Vgt that can be as low as -1v, meaning that for some settings the output
may not be able to follow the input as expected. The behavior can change
a bit over temperature too, so a single measurement at room temperature will
not be enough to validate the design. It's also a bit difficult to predict the
behavior without making several measurements at several different temperatures
(or at least at the extremes of operation) so an idea might be to add a diode
in series with the output of the op amp to force the output to always be
one diode drop above the max output. Since the max output will be 10.5,
one diode drop above that will take it to 11.1v, and this should be enough
to make sure the circuit works ok over a wide temperature range.
Because the diode also introduces some asymmetry in the drive circuit, a
pullup resistor will then be required as well as the diode.
This diode would connect cathode to the output of the op amp, with 100k
in series with the diode and the other end of the 100k to the gate. The pullup
would then go from +12v to the diode anode. A value of 10k for the pullup
should be sufficient.
With the addition of the diode we also loose the other end of the drive where
the transistor turns on fully, but because the supply is so high and the Vgt
so low we know that it will always be able to turn on fully even with a loss
of 0.6v in the max drive voltage.
LEDs vs Bulbs, LEDs are winning.

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

Re: Help with comparator design

Post by trident » Tue Feb 17, 2009 11:24 pm

MrAl wrote: With an op amp like the one shown in the schematic (1/2 of LM392) the output will not be able to reach +12v ... so an idea might be to add a diode in series with the output of the op amp to force the output to always be one diode drop above the max output.
Hello

Switching the amp to negative negative feedback and the input signal to the non-inverting input could I use a transistor in this way rather than a diode as you suggested? The part count would be the same. Also is there any opinions as to splitting the comparator output pull-up to set a minimum final output level rather than applying a bias voltage to the op-amp section?

Regards,
trident

Image

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

Re: Help with comparator design

Post by MrAl » Wed Feb 18, 2009 11:34 am

Hi again,


I suppose that added transistor configuration would work ok, although i am not
sure why you would want to use a transistor and not at least try the LM339
for an op amp as well as the comparator. If you do use the transistor though
when it is driven from a voltage source (output of op amp) sometimes you need
a base resistor (like 1k) to prevent an accidental forward bias of the base
collector junction, which causes latch up and with this circuit would mean the
output voltage would drop to zero and stay there until the circuit was turned
off and then back on again. It's hard to determine if this will happen with every
circuit and it depends partly on how stable the circuit is during normal transients.

You can most likely get away without using R5 and R6 (to get a min output)
if you instead connect the 100k (R7) directly to pin 1 of the comparator and
connect a 150k resistor from C2 to +3v. This will effectively do the same thing.
The ratio of the two resistors is the same as the old R5 and R6.

Hope you get this up and running soon so we can hear about some results :smile:
LEDs vs Bulbs, LEDs are winning.

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

Re: Help with comparator design

Post by trident » Thu Feb 19, 2009 11:09 am

MrAl wrote: You can most likely get away without using R5 and R6 (to get a min output)
if you instead connect the 100k (R7) directly to pin 1 of the comparator and
connect a 150k resistor from C2 to +3v.
Hello

If a 150K resistor is connected to C2 would this not change the cutoff frequency of the low-pass filter by decreasing the effective series resistance C2 sees to about 60K? If I use the split pull-up configuration, R5 and R6 add to the series resistance. I would like to keep the values of R7 and C2 as small a possible and because I am using strip board, R6 replaces a jumper wire and will not effect the layout.

Regards,

trident

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

Re: Help with comparator design

Post by MrAl » Fri Feb 20, 2009 5:14 am

trident wrote:
MrAl wrote: You can most likely get away without using R5 and R6 (to get a min output)
if you instead connect the 100k (R7) directly to pin 1 of the comparator and
connect a 150k resistor from C2 to +3v.
Hello

If a 150K resistor is connected to C2 would this not change the cutoff frequency of the low-pass filter by decreasing the effective series resistance C2 sees to about 60K? If I use the split pull-up configuration, R5 and R6 add to the series resistance. I would like to keep the values of R7 and C2 as small a possible and because I am using strip board, R6 replaces a jumper wire and will not effect the layout.

Regards,

trident
Hi,

The -3db point changes from 16Hz to 32Hz, and lets not forget the output is a fan, not a
100 watt PA audio system. The slight increase in output ripple wont affect anything.
The first harmonic ripple at 25kHz and 3v with 100k is 0.0019v, and with 60k
it is 100/60 times that, or 0.0032v, which is still quite insignificant for a fan motor
which shouldnt produce any noticeable audio. With a 5v min output dc voltage this
ripple is 0.06 percent of nominal which is almost -32db down from nominal which is better
than some audio systems. :smile:
LEDs vs Bulbs, LEDs are winning.

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

Re: Help with comparator design

Post by trident » Sat Feb 21, 2009 8:32 pm

Hello

The suggestion from MrAl about adding a bias voltage to the low-pass filter got me to thinking and I just may have arrived a the minimal configuration that meets my design goals. I originally chose a comparator to eliminate any offset voltage from the mother board output. If this new and hopefully final design is a viable configuration, it can compensate for the motherboard offset, offset from the buffer output and enable the minimum output to be adjusted as well. The NDP6030PL was replaced with a FQPF7P06, it has a minimum Vgs(th) of -2.0 volts. High frequency noise should also be attenuated with the low-pass at the front end of the circuit. Are there any issues I have not addressed in this last design?

I must apologize for my novice errors. I should have educated myself better before jumping into this project. Some twenty years ago I designed several digital projects that turned out quite well. Digital IC's can be stacked together almost like "LEGO" blocks and all they ask for is stable supply voltage and a few bypass caps. Only recently, after much study of the subject, have I been able to appreciate some of the trap doors that are waiting for a beginner building with op-amps. Thank you to all who invested their time and effort in my continuing journey to a better understanding of the op-amp.

Best regards,
trident

Image

Post Script
A typical mid-tower computer chassis has a volume of 40 liters and has two large parallel surfaces. Low frequency noise is difficult to attenuate in this type of environment. Standing waves can develop and produce an effect known as cavity resonance. There is not sufficient room to add enough acoustic absorbent material without disrupting air flow through the chassis. A 7200 RPM hard disk drive can radiate significant acoustic energy in the 120Hz range. The most successful damping method I have found is to decouple the HDD from the chassis and the volume of air inside the chassis. With a cooling fan this is not possible as it is inherently coupled to the air volume within the chassis. The point I wished to convey was that the cutoff frequency of the low-pass filter was shifting into the audible range with the addition of the 150K resistor. I agree that the change is small, but aging and thermal drift of the X7R ceramic capacitor will also shift the cutoff frequency higher. A C0G dielectric would be a better choice for the low-pass, however C0G capacitors have almost 10 times the physical volume of the same value X7R capacitor and in small quantity a 0.1uF C0G is about a $5 purchase.

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

Re: Help with comparator design

Post by MrAl » Sun Feb 22, 2009 3:36 pm

Hi again,


First off, 0.0032v into 8 ohms only produces about 1.2 uwatts of power.
I doubt you can hear this over the sound of the fan itself, and the
fan probably has a higher internal resistance than that even.
As per your other notes, keep in mind that a filter specification of
-3db (or whatever) at some specified frequency doesnt necessarily imply
good or bad operation at any other frequency (or the same frequency)
in itself, it depends on the application and how the levels drop off
and the ratio of these levels relative to some other measurement(s).
In other words, just because we specify the filter at some level
at 32Hz doesnt mean it wont work because 32Hz is within the human
hearing range...we could have specified it at 132Hz and still ended
up with a decent filter for this application. The -3db specification
is more for comparing one filter to another rather than comparing
one filter to an application or for trying to determine the suitability
of a given filter for a given application unless we already took into
account the practical aspects of that kind of comparison.

Your new circuit isnt too bad either though, but again if you use
a -2v Vgt for Q1 you might run into the problem of pin 7 not being
able to go high enough to turn Q1 off enough. A little diode with bias
as previously discussed would help there. Even a Q1 with -4v Vgt may
not turn off properly when needed over a given temperature range
without proper biasing.

Where did C5 come from and what is its purpose? If you need more
filtering you are probably better off increasing C4 as C5 may
cause some instability. Test it out and look with a scope if possible.
LEDs vs Bulbs, LEDs are winning.

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

Re: Help with comparator design

Post by trident » Wed Feb 25, 2009 9:30 pm

MrAl wrote: 1)First off, 0.0032v into 8 ohms only produces about 1.2 watts of power.
I doubt you can hear this over the sound of the fan itself
2)Your new circuit isnt too bad either though, but again if you use
a -2v Vgt for Q1 you might run into the problem of pin 7 not being
able to go high enough to turn Q1 off enough.
3)Where did C5 come from and what is its purpose? If you need more
filtering you are probably better off increasing C4 as C5 may
cause some instability. Test it out and look with a scope if possible.
1)At 7 volts supply the fan I will be using will be <[email protected], Inside the chassis it will be close to inaudible unless it is buzzing or ticking.
2)In this application the fan will always be running. If Q1 can limit the final output to 5 volts that will be good enough.
3)C5 is a filter for commutation noise from the fan motor. Wish I had a scope, best I can do at this time is a FLUKE 112.

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

Re: Help with comparator design

Post by MrAl » Thu Feb 26, 2009 1:23 pm

trident wrote:
1)At 7 volts supply the fan I will be using will be <[email protected], Inside the chassis it will be close to inaudible unless it is buzzing or ticking.
2)In this application the fan will always be running. If Q1 can limit the final output to 5 volts that will be good enough.
3)C5 is a filter for commutation noise from the fan motor. Wish I had a scope, best I can do at this time is a FLUKE 112.

Hi again,


Well, if your MOSFET starts out at Vgt=-1.8v at 25 deg C and since it has a positive temp co it could
creep up to -1.5v or even a bit higher which could cause a problem. The likelihood that the transistor
will at least get warm is very high since it is being operated in the linear mode where heating is always
present, and at about 1/2 Vcc it's almost worst case.
You may get lucky however in that the MOSFET Vgt starts out at -2.5v and only creeps up a little.
LEDs vs Bulbs, LEDs are winning.

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests