Linear transistor control/driver, simple solution?

Discussion in 'The Projects Forum' started by dr.evil, Sep 10, 2010.

  1. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    Dear fellow scientists

    In my continues effort to complete my “doomsday” machine, I need a control the output of a voltage regulator LM317 with an input on the BC547’s base (see attached), the control signal I have is an output from a DAC, the problem is of course that the DAC’s output is linear and the transistors output is not and the resulting resolution is useless. How do I get linear output from the transistor and subsequently the voltage regulator with a linear control signal?

    I tried to run a simulation with a op-amp coupled as exponential amplifier, but it seems to be very difficult to “tune” it exactly, is there a simpler solution?

    Thank you
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,085
    3,024
    How do you NOT get linear output? In my experience, the voltage across the transistor will be roughly 0.7 volts more than the base voltage, very linearly over a fairly wide range. I suppose different transistors will give different results over a given range.

    At the risk of helping lead to my own doom...
     
  3. marshallf3

    Well-Known Member

    Jul 26, 2010
    2,358
    201
    Umm, transistors have gain, once biased on they go to the minimum resistance between the CE junction pretty quickly.
     
  4. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    You can lift that 150 to at least 220 which will help a little.

    Remember you have a minimum load requirement on the reg and that will have to be maintained at your lowest output voltage.

    Is your DAC output clean? have you tried adding smoothing and bipas caps?

    Whats your current requirement, could you use an opamp with a buffer transistor configured as a voltage follower, you wouldnt get much more linear than that and the transistor would be handled / compensated for by the opamp.

    Al
     
  5. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    I believe marshallf3 have pinpointed the problem I have in this circuit, but how to overcome it? to use something else instead of a BJT transistor? a FET or LDR?
     
  6. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    Dear Dyslexicbloke,

    DAC output is clean and very very extremly low frequency, I only use the LM317 as a voltage regulator, and I use power FET's for up to 30A current bypass.

    When you say "opamp with a buffer transistor configured as a voltage follower" you mean like Fig. 14 in this document?

    http://www.st.com/stonline/books/pdf/docs/1707.pdf
     
  7. Wendy

    Moderator

    Mar 24, 2008
    20,764
    2,534
  8. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Yes exactly like that .. the transistor is inside the negative feedback loop so the amp will compensate for whatever gain it has, linear or otherwise.
    look at this:-
    http://www.ecircuitcenter.com/circuits/opreg1/opreg1.htm

    If you take out the devider, inverting input directly to Q output, and put your DAC output on the none inverting input instead of the ref from the zener you will be there.

    Use a fet input amp if you can .. you can ignore input bias current then.
    should work no problem.

    Somthing I learned yesterday ...
    Put a bypass cap on the opamp rails, just whatever the datasheet recomends, you will probably find that it will spec 0.1uF

    Al
     
  9. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    @Bill_Marsden, thank you for your suggestion, it is definitely a solution, but since I’m using a serial DAC and limited by output pins on my PIC it would increase component count drastically. But I will have it in mind for future projects.

    @ Dyslexicbloke, thank you for your suggestion, I like it and I will use it if everything else fails, however I’m already planning a version 2 of the “doomsday” machine (codename “The redeadening”) where I want to make it switchmode using a AMC34063 and here the output voltage is also controlled in a similar way as the LM317 i.e. with a voltage divider, and then I will experience the same problem, so maybe I should solve the problem now once for all. You say “the transistor is inside the negative feedback loop so the amp will compensate for whatever gain it has, linear or otherwise” and the keywords I guess is how to compensate for gain? Can the gain compensation be done in a similar manner as per your suggestion, and still use the transistor in conjunction with the LM317? Sorry for being silly, but analog design is still black-magic for me.
     
  10. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    The LM317T, and several other simmilar parts for that matter, use the current flowing out of the programming pin to set their impedance and hence a voltage for any particular load.

    The devider between the output and ground, in this case, is forced by the internal the circuitry to 1.2 volts, the current it takes to achieve that is used to set the output. if the output voltage starts to fall, when the load increeses for example, then to maintain 1.2V on the programming pin the current fed to it must be increesed an so the output impedance is decreesed, because of the internal relationship between the two, and the system will stabilise again maintaining the voltage across the load.
    It is also important to note that ground dosnt have to play a part in this equation at all. Anything that modifies the voltage fed back to the programming pin will force the device to modify its internal drive current, in an attempt to reestablish the 1.2V reference.
    This very useful for generating a constant currnt source ...
    if you put a series resistor in the output leg and connect the programming pin to the load side of this resistor you will get a current exactly equal the 1.2V drop across the resistor .... neet Eh.
    Put a FET in place of the resistor, operating in its linear region, and you have a voltage controlled current source or limmit. It will work as a limmit because the reg is wide open untill the 1.2 threshold is reached at which point it rapidly backs off.

    But I digress .....
    NO, was the short answer, at least not with any form of advantage.

    I supose in theory you could fool it by having the opamp sink its programming current, to be honest i'v never tried or seen an example of that.
    I would expect that would reduce the accuracy of regulation, in comparison to a single transistor, rather than help in any way.

    Just a hunch but you would probably be adding a load of latentancy to the feedback loop and increesing the posibility of the system as a whole starting to oscilate.

    That however, is way beyond my ability to predict ... I am strictly a datasheet guy unless I have to play, and i'v never played with that setup.

    Try it you wont kill the reg they are prety much indestructable unless you realy try.

    Have fun
    Al
     
  11. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    Dear Dyslexicbloke

    Thank you for your thoughts on this matter, I guess the conclusion is, that if I want to solve this matter quickly once and for all, then I will have to pursue the traditional solution as proposed by Bill_Marsden, in my case I will have to make a serial 8bit digi-pot.

    I take this opportunity to thank everyone for their input, as a token of my appreciation I will give everone a heads-up when my "doomsday" machine is finished, so that you can run for shelter..
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Only if the current through that resistor + the minimum load will be >= 10mA.

    The LM317 requires a minimum 10mA load in order to provide guaranteed regulation.

    Unfortunately, changing the value of that resistor higher will not help the non-linearity one bit.

    An opamp with gain of roughly 3.5-4 is what our OP needs.
     
  13. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    As I inferred already, you need a non-inverting opamp circuit with a gain high enough to translate your DAC's output from it's range to the desired LM317 output range.

    If you have ~20v in, your LM317's output can then vary between roughly 1.25v and ~20v-2.5v, or 17.5v.

    Assuming that your DAC has an output range of 0v to 5v, then you need a gain of about 3.24.

    You will need to power the opamp from your ~20v supply.

    Here is a page in our E-book that gives you an idea of a non-inverting opamp that has gain:
    http://www.allaboutcircuits.com/vol_3/chpt_8/5.html

    Note the formula for gain (Av) for a noninverting amplifier:
    Av = (R1/R2)+1

    Look at the attached; I'm using a common LM324 opamp, which can sense/output nearly down to ground. You won't be able to use other common opamps, like an LM741, TL082, LF353 etc. because they require dual supplies and won't go to ground.

    You will need to do something with unused opamp channels' inputs; they cannot be left "floating" or you will experience problems; namely high-frequency oscillations. One good solution is to ground the unused non-inverting (+) inputs, and connect each inverting (-) input to it's respective unused output.

    Note also that it's preferable to keep feedback resistors in the range of 10k to 100k for a typical opamp. If you go too low in resistance value, you can hamper the amp's ability to output sufficient current. If you go very high in resistance, you can introduce noise.
     
    Last edited: Sep 12, 2010
  14. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    Dear SgtWookie

    Thank you for your proposal, I tried to run a simulation, and amazingly - it is linear indeed, I will try soldering it up tomorrow.

    But how does it work? I understand the non-inverting opamp with a gain of 3.24 part, but why does it work together with the 120 ohm reference resistor?

    Could the same circuitry be applied to AMC34063 i.e. replace R2?
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    And why shouldn't it be? It was linear in mine, too. :)

    Keep in mind that the opamps' input offset will also be multiplied by the gain. However, that's pretty easy to compensate for, since you're going to have to do more or less of a calibration on it anyway.

    A couple things I omitted from the schematic are:
    1) A small resistor (say, 22 Ohms) from +V to the Vcc terminal of the LM324, and an 0.1uF bypass cap across the LM324's Vcc and ground terminals. The cap is not optional. The resistor and cap will help to keep the opamp's supply nice and quiet.

    You may also wish to use a small cap from the junction of R1/R2 to ground; in the neighborhood of 47pF to 1nF (1,000pF)
    That will keep the junction nice and quiet.

    You may also wish to use a resistor (say, 1k-4.7k) to connect your DAC output to the opamps' noninverting (+) input, and a cap in the range of 1nF to maybe 22nF from that same input to ground. DAC outputs can be a bit noisy.

    OK, I used a 120 Ohm resistor in order to satisfy the minimum 10mA load requirement for guaranteed regulation; if you have less of a load, the Vout will be somewhat higher than it's supposed to be.

    Vref is documented in the LM117/LM317 datasheet. Vref is the difference in potential between the OUT and ADJ terminals, and it is nominally 1.25v. The regulator attempts to keep Vref constant, which is how it regulates voltage or current. However, it may fall in a range anywhere from 1.2v to 1.3v and still be within manufacturer's tolerances; so you have to plan for the worst case scenario.

    Therefore, 1.2v/120 Ohms = 10mA, which satisfies the minimum current requirement.

    If you will have a minimum of some other load on the output, say an LED lamp with a constant current driver, you can increase it somewhat. However, beware that there is a small current issued from the ADJ terminal; nominally 50uA - and the further you increase over 120 Ohms, the larger the resulting error will be. You can go below 120 Ohms, but if you're regulating voltage, this results in wasted power.

    Ahh - not really, but "sort of".

    That regulator gets it's feedback by the R2/R1 relationship, and the junction is compared to 1.24v.

    You might use the output of an opamp via a resistor to the junction of R1/R2 to make a summing circuit. I don't have any of those IC's to experiment with, and I'm not sure how good the SPICE model of it is.
     
    Last edited: Sep 12, 2010
  16. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Dont take this the wrong way, I am not questioning the solution in any way, in fact I like the look of it because 317's are prety hard to break and its simple.

    I'm confused though, would an opamp with a power transistor on its output not have worked? it could still have had the same devided feeback network.
    I just want to understand where I am / was going wrong.
    Al
     
  17. dr.evil

    Thread Starter New Member

    Aug 18, 2010
    12
    0
    Dear SgtWookie
    Thank you for your educational answer, so if I understand you correct, the function of the op-amp is solely to manipulate the difference in potential between the OUT/ADJ and GND? and not to mimic a resistor?

    Dear Dyslexicbloke,
    I’m not sure if your last question was directed at me, but if it was, then I believe that your solution in the end accomplishes the same as SgtWookie’s, but I already have the LM317 and FET’s soldered together, so I will go with SgtWookie’s solution.
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    An opamp providing base current for a BJT or Darlington power transistor certainly could work, but it would have none of the protection features that are built-in to the LM317 - unless you went to a good bit of extra trouble to add it in. What's the point of doing that if you're trying to keep it simple?
     
  19. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    The opamp multiplies the DAC output by a fixed amount, and within limits keeps the output at that same multiplication factor.
    Since Av=1+(R2/R1), the circuit I posted has a gain of 3.35; very close to the 3.24 I originally proposed, and uses standard values of resistance that are easy to obtain.

    The LM317 attempts to maintain Vref (which is Vout - Vadj) at a constant voltage; nominally 1.25v. So, your output will be V(DACout) * 3.35 + opamp_input_offset * 3.35 + Vref.

    Does that make sense now?
     
  20. Dyslexicbloke

    Active Member

    Sep 4, 2010
    420
    19
    Good I am on the right page then but as always 'You da man'.

    Cool solution and one I will be making good use of in the future.
    My standard stock regs are 317's and 350's and this is another realy useful way to utilise their virtues.

    Thanks ...
    Al
     
Loading...