Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 25
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
05/04 Matthew T. (35)
05/04 Amrit Deshmukh (60)
05/05 Alexandre (32)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: General Science and Electronics
« Previous topic | Next topic »   

Strange/Poor Response with LM339 Comparator. Help Requested.

1 2 
Move Thread LAN_403
Sigurthr
Fri Feb 13 2015, 03:18AM Print
Sigurthr Registered Member #4463 Joined: Wed Apr 18 2012, 08:08AM
Location: MI's Upper Peninsula
Posts: 597
Hello everyone!

I'm working on a SMPS and I grabbed a comparator for the feedback as I'm doing this one sans uC. I've never used a comparator in such a demanding application before (previous uses were just logic signals or light sensors, etc) and I've observed strange behavior in my circuit. So, I took the comparator out and made a test jig on breadboard to examine the chip's operation.

Now, I realize it is a REAL component, and not an IDEAL one, but I was expecting behavior to more closely match what an ADC channel on a uC would do; a fixed offset range of indeterminate output (in a uC it's related to the ADC's bit depth and input range).

Here's my test jig and results; 5V is regulated, decoupled, and filtered. Hysteresis was added on both inputs and output in second test, no change in behavior noted from zero hysteresis.
Hkc9V5S

As you can see there is a rather large voltage offset between inputs and switching point (+-20mV or +-50mV), and the offset is not identical both ways. Between the reference voltage and the input switching point the output oscillates. With Vref on the Non-Inverting Input it oscillates at (Vref - 20mV) to (Vref + 20mV). That's 40mV of feedback range which equates to a 5.6V range on the SMPS output. If I use the Inverting Output for Vref it is 100mV of feedback range, which is 14V of range on the SMPS output. (140:1 divider) This makes certain loads really throw the smps out of regulation.

With a 10bit 5V ADC There's only ~24mV of indeterminate range, and you can code it to largely rule that out and always output a certain way in that case, negating the problem. I thought going analog would offer better precision!

I was expecting a couple mV of this indeterminate state range, not 40mV or 100mV! Is my chip damaged? Did I make a simple mistake in application here?
Back to top
Carbon_Rod
Fri Feb 13 2015, 03:49AM
Carbon_Rod Registered Member #65 Joined: Thu Feb 09 2006, 06:43AM
Location:
Posts: 1155
IIRC the Schmitt trigger comparator needs a feedback resister to your Vref.
wink
Back to top
Sigurthr
Fri Feb 13 2015, 06:53AM
Sigurthr Registered Member #4463 Joined: Wed Apr 18 2012, 08:08AM
Location: MI's Upper Peninsula
Posts: 597
Hmm, didn't see that in any of the app notes in the datasheet or searched circuits, not doubting you though as something sure is wonky. Any more detail on application of said feedback resistor? Appropriate values, formulae, etc?
Back to top
Carbon_Rod
Fri Feb 13 2015, 07:04AM
Carbon_Rod Registered Member #65 Joined: Thu Feb 09 2006, 06:43AM
Location:
Posts: 1155
Try 33k from pin 1 to pin 7 of cicuit 2 to help set the hysteresis...
so switching time will be sharper.

LGTFY:
Link2
wink

Cheers,
Rod
Back to top
Shrad
Fri Feb 13 2015, 08:14AM
Shrad Registered Member #3215 Joined: Sun Sept 19 2010, 08:42PM
Location:
Posts: 780
those which are not schmidt trigger will usually require a capacitor in parallel to that resistor to integrate over the acceptable range of variation to prevent oscillation or spurious events if you use it in a control loop

also keep in mind that you're usually better working in a zone around +2V/3 and -2V/3 for future part replacement (not all accept the same ranges) and that comparators usually behave unexpectedly when supply voltage is lower than a safe value so always use a power-on delay for the supply to reach its nominal value
Back to top
Sigurthr
Fri Feb 13 2015, 08:40AM
Sigurthr Registered Member #4463 Joined: Wed Apr 18 2012, 08:08AM
Location: MI's Upper Peninsula
Posts: 597
Thanks!

Yep I had tried the parallel capacitance on I/O pins, didn't make a difference. Didn't know about the positive feedback resistor though, will give that a shot tomorrow.
Back to top
mister_rf
Fri Feb 13 2015, 08:49AM
mister_rf Registered Member #4465 Joined: Wed Apr 18 2012, 08:37AM
Location: Bucharest, Romania
Posts: 145
I have done my tests with an LM2901, and the input offset voltage was normal, as expected. (less than 5mV).
That’s a chance for an out of specs circuit. sad

Back to top
Wolfram
Fri Feb 13 2015, 01:38PM
Wolfram Registered Member #33 Joined: Sat Feb 04 2006, 01:31PM
Location: Norway
Posts: 971
It sounds like your circuit is operating correctly, but oscillating when the input voltages are close. This is probably caused by capacitance between the output and the inverting input, or missing decoupling capacitors. Do you have proper decoupling caps directly between VCC and GND of the comparator? If the decoupling is fine, you could try adding some capacitance across C3 to decouple the reference voltage for the comparator.

You don't want to use a comparator as a feedback amplifier, unless you're doing pulse skipping or something like that. A regular op-amp is more suited for the job.
Back to top
Sigurthr
Sat Feb 14 2015, 01:13AM
Sigurthr Registered Member #4463 Joined: Wed Apr 18 2012, 08:08AM
Location: MI's Upper Peninsula
Posts: 597
@Wolfram The VCO I'm using has nasty instability at the upper edge of acceptable Vset range, so I'm using pulse skipping via the enable line and manual frequency adjustment. It won't be seeing dynamic loads, it just has to be relatively stable throughout the wide operable range. On a fixed voltage converter or one with less input/output range I'll have to look at using a regular op-amp and controlling the output via oscillator frequency.

I was careful with stray capacitances and I always decouple all of my ICs.

@Carbon Rod that 33k between Vref and Output did the trick! Thanks a ton!

I made a reference schematic for future readers and google searchers so that they won't wind up with the same issue. Credit was given where due! =)

How to Use a LM339 Comparator:
ViG45P3

Picture of the SMPS in action: 12V IN; 177V OUT.
HWQiRMl
Back to top
mister_rf
Sat Feb 14 2015, 09:35AM
mister_rf Registered Member #4465 Joined: Wed Apr 18 2012, 08:37AM
Location: Bucharest, Romania
Posts: 145
In my opinion if you use the 33k resistor that’s too much hysteresis added. shades
I’ll prefer to use at least ten time the actual value, let's say a minimum value of 470k.

Link2

Link2

Back to top
1 2 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.