Opamp to control FET resistance -stability issue - diyAudio
Go Back   Home > Forums > General Interest > Everything Else
Home Forums Rules Articles diyAudio Store Gallery Wiki Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools......

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Thread Tools Search this Thread
Old 6th May 2014, 10:24 PM   #1
diyAudio Member
Join Date: Feb 2010
Default Opamp to control FET resistance -stability issue

Its for an ambient light sensor to control a 0-2V analog dimming input on a display driver chip.
The board has a 4k7 pull-up resistor - this is shown as R2 in the circuit, and i need to pull this down to near zero volts at zero light.
This is one circuit i have tried, but like similar others it is unstable. I have built a few different versions, with both LDR's and various diodes, fast and slow amps, etc. I can stabilise it in spice, but the working version always seems to oscillate at various intermediate light levels.

Any help appreciated.
Attached Images
File Type: jpg LightSensor31.jpg (89.0 KB, 94 views)
File Type: jpg 2014-05-06 22.42.51.jpg (365.0 KB, 89 views)
  Reply With Quote
Old 6th May 2014, 10:51 PM   #2
diyAudio Member
Join Date: May 2011
Location: Silicon Valley
Have you ever tried plotting the open loop transfer function using SPICE ".AC analysis"? It can tell you the gain margin and phase margin (two measures of stability).

I think you may have a lot more success if you change topology, and use your low-VT BSS145 Nchannel MOSFET as a noninverting source follower, to pull up the 0V-2V output signal. Put the 4.7K to ground in parallel with the load, just to pull it down an extra amount, for safety. Now your feedback loop only includes a single gain stage (the opamp); the NMOS source follower has unity gain and contributes negligible phase shift. Select a low-GBW 5 volt rail-to-rail opamp like the Microchip MCP6002 and stability problems become a thing of the past.
  Reply With Quote
Old 6th May 2014, 11:12 PM   #3
diyAudio Member
Join Date: Feb 2010
Thanks Mark, i had initially discounted the pull up idea, I had hoped not to have to modify the original circuit. Basically i could just pull the plug and walk away if anything went wrong.

Only began using Lt spice very recently, so need to do a bit more on that, but I had an inkling there are too many gain stages.

I am using some 27L2c out of the junkbox, will the MCP do a better job?
  Reply With Quote
Old 7th May 2014, 12:26 PM   #4
diyAudio Member
Join Date: May 2011
Location: Silicon Valley
Whenever I work with "5 Volt" supplies, I imagine they are 5V 10%, and I expect that Murphy's Law means that my supply will output 4.5 volts. Maybe not when I'm measuring it, but sometime in the future when the equipment is being actively used, "in the field".

So I always choose a Rail-to-Rail Input AND Rail-to-Rail Output opamp for 5V applications -- when the supply is 4500 mV, there just aren't very many millivolts to throw away. The 27L2c is not Rail-to-Rail, either on the inputs or on the outputs. That's what the datasheet says (attached). Personally, I wouldn't use that opamp for a 5V project.

There are lots of 4.5V compatible, Rail-to-Rail Input AND Rail-to-Rail Output opamps. I generally choose Microchip because (1) they're inexpensive; (2) their datasheets are straightforward; and (3) they are in stock, on-the-shelf at the factory authorized distributors I like to buy from.

Attached Images
File Type: png datasheet_TS27L2C.png (76.5 KB, 68 views)
  Reply With Quote
Old 7th May 2014, 01:35 PM   #5
Mooly is offline Mooly  United Kingdom
diyAudio Moderator
Mooly's Avatar
Join Date: Sep 2007
You have got the sensor totally and fully shielded from the light it controls ?

C3 looks a bit unlikely tbh. I would have thought that an ambient detector would and should be slugged right down, perhaps by making C2 a 0.1 uf (or more). I would investigate the effect of C5 too.
  Reply With Quote
Old 7th May 2014, 02:06 PM   #6
The Dastardly Dad of Three
diyAudio Member
Join Date: Sep 2009
Why so many parts ? Why not just feed the MOSFET gate off a junction between ldr and pot to the rails. Maybe add a small Elco across.
  Reply With Quote
Old 7th May 2014, 05:23 PM   #7
cbdb is offline cbdb  Canada
diyAudio Member
Join Date: Oct 2008
Location: Vancouver
Dosnt look like you need much bandwidth, so add largish (Miller) caps across the feedback resistors. Should stop the oscillation if it's in the opamps
  Reply With Quote
Old 7th May 2014, 11:59 PM   #8
diyAudio Member
Join Date: Feb 2010
OK so the 27L2c is back in the bin, thanks Mark, its really rubbish at 5v, cant think why i thought it was rail to rail.

I stuck in C3 and C5 in the sim to try to damp it down a bit. Sort of works - any larger values the sim goes haywire, but in the flesh, large values work better. I left the feedback caps as low as possible to help indicate if there is instability.

Kasey, I'm usually up there with you in this, but i wanted to be able to control the gain and hi and lo range of the output. I need the full range of the 0-2v
  Reply With Quote
Old 8th May 2014, 12:06 AM   #9
diyAudio Member
Join Date: Feb 2010
Mark i thought of what you suggested initially, this one sims much more stable, but still, I'm not ready to trust it yet.

It appears its not unity gain stable. Increasing the value of R12 increases gain, but not stability. Likewise with C2. ???

Last edited by whizgeek; 8th May 2014 at 12:09 AM.
  Reply With Quote
Old 8th May 2014, 12:09 AM   #10
diyAudio Member
Join Date: Feb 2010
sorry, image included
Attached Images
File Type: jpg LightSensor41.jpg (28.4 KB, 44 views)
  Reply With Quote


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thermal Stability of Lateral FET Driven Bipolar Follower. Andrew Eckhardt Solid State 8 24th January 2013 10:09 AM
opamp stability simulation in LTSpice Preamp Software Tools 2 17th December 2012 07:59 PM
soundcard OPAMP mod stability issue Leolabs Digital Line Level 0 17th September 2008 01:59 AM
fet output stage stability lowlevel Solid State 11 17th January 2005 11:48 AM
Fet Follower Regulator On Resistance? macka Pass Labs 2 25th December 2004 03:35 AM

New To Site? Need Help?

All times are GMT. The time now is 04:06 AM.

vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Copyright 1999-2017 diyAudio

Content Relevant URLs by vBSEO 3.3.2