Shop OBEX P1 Docs P2 Docs Learn Events
Op amp help — Parallax Forums

Op amp help

grasshoppergrasshopper Posts: 438
edited 2008-12-22 19:05 in General Discussion
I am thinking about implementing this Op-amp and transistor into a design that I am working on. My problem is that I am thinking that this circuit would never be able to keep the motor off. Since this is a non inverting amp circuit I can envision that over time a bit of leakage current from the transistor would begin to drive the output in effort to balance the input. I like this design because it allows me to use negative feedback. This way if my motor is having a bit of lag the amp would increase the current to compensate for it.

Any ideas about this thought I am having?
**** Edited *****
opamp2.jpg

Post Edited (grasshopper) : 12/21/2008 4:38:03 AM GMT

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-21 04:51
    That circuit should work fine if your objective is to control the voltage going to the motor. It's more usual in motor control situations to control the current, though. To do so, all you have to do is move the motor to the collector side of the drive transistor and replace it on the emitter side with a current-sensing resistor. In any event, depending on the motor's current draw, you may need to heatsink the transistor. It's operating linearly and could get very hot!

    -Phil
  • grasshoppergrasshopper Posts: 438
    edited 2008-12-21 05:34
    Could you point me in a direction regarding the collector vs the emitter configuration. Why would this change the characteristics of the controlling of the motor? ill begin the googling but perhaps you may have something?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-12-21 11:53
    www.phy.davidson.edu/instrumentation/NEETS.htm

    The above link with offer you over 20 modules for self learning of electronics. One in particular deals with solid-state devices and another with op amps.

    You certainly don't have to read the whole set in one go. But it is quite handy to have for reference. Texas Instruments has a similarly large tome on just Op Amps.


    As you can see, the internet really offers more than you want to know when it comes to computers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    How do you like my name change?

    aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
  • grasshoppergrasshopper Posts: 438
    edited 2008-12-21 15:15
    Thanks for the ref material, I am still confused however.

    I thought an emitter follower as not to be a voltage gain, but current or power gain and used for impedance matching. My circuit above is in the emitter follower configuration because I need to control current. Phil suggested that a common emitter configuration would be more practical. Perhaps Phil is misleading or I have forgotten somethings about the transistor.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-12-21 17:05
    Grasshopper,

    Phil would not mislead you!

    It is true that the emitter follower configurion will give you current or power gain, and can be used to match a high impedance to a low impedance. But that does not mean it "controls current" in the sense you implied. It is more correct to say that output voltage = input voltage - 0.6. The transistor is really regulating the output voltage to equal the input voltage, and it supplies supplies just exactly enough current to do that. In this circuit, the power or current gain means that the op amp itself has to supplly only a small current to the base of the transistor and most of the current to drive the motor comes from the power supply. The feedback in the op amp has the effect of removing the offset voltage, so in the circuit below, the voltage across R2 equals the input voltage. In your circuit, the output voltage would be a multiple of the input voltage, depending on the ratio of your feedback resistors. That voltage will not change, even if you change the value of the resistor R2, within limits, or even if R2 is a variable load like a motor. It is the voltage that is regulated.

    Now think about the resistor R3 in the circuit below. The transistor and the op amp feedback regulate the voltage across R2, so the current through R2 is constant. This assumes that R2 is a fixed resistor, not a variable load like a motor. The same current flows through R3 that flows through R2. Even if R3 is a variable load like a motor, the current through it will be Vin/R2. It is the current that is regulated in the collector circuit. There is actually a small current difference in current between R2 and R3 to to the base current. That can be reduced if you use a mosfet or superbeta or darlington transistor. In general, when speaking of transistors, the collector acts like a current source or sink.

    attachment.php?attachmentid=57475

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    210 x 177 - 4K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-21 18:38
    Thank you, Tracy! (Misleading, indeed!) 'Sorry I couldn't jump on this more quickly. The computer that hosts the schematic drawing program is in my shop, and there was a snowdrift blocking the door this morning. Grasshopper, be thankful for that: Tracy (as usual) gave a you a very thorough explanation — moreso than I would have!

    Expanding on the practicalities a little, consider the following schematic:

    attachment.php?attachmentid=57476

    Neglecting base current, the current through the motor will be

    ····Vinp / R

    For motors that don't draw much current, we could stop there, and just pick a value for R that equals

    ····Vinp(max) / Imotor(max)

    For example if Vinp(max) is 5V and we want the maximum motor current to be 100mA, then R would have to equal 50 ohms. The maximum power dissipation in the resistor is then

    ····5V × 0.100A = 0.5W

    so a half-watt resistor (or two 100-ohm quarter watters in parallel) will do the job. We need to make sure, though, that the voltage supplying the motor is at least enough to power the motor, plus the saturation voltage of the transistor, plus the five volts maximum across R.

    But what happens when we want to supply up to an amp to the motor? That would require that R be at least a 5W resistor! So, somehow we need to reduce the voltage across R to something more like half a volt. This can be done with a divider on the input, viz:

    attachment.php?attachmentid=57477

    Now, the maximum voltage across R, given a maximum 5V input voltage is

    ····1K/(9.1K + 1K) × 5 = 0.495V

    But there's still a problem. If Vinp is being produced via a BASIC Stamp's PWM command, once the prescribed time interval is up, the pin reverts to an input state. The idea is that the capacitor will hold the charge until the next time a PWM occurs. But with the divider resistor in place, the cap will discharge very quickly, reducing the motor current to zero.

    The solution is to buffer the PWM input, like this:

    attachment.php?attachmentid=57478

    Now the PWM can drive a high-impedance input, as in the first schematic, letting the buffer amp handle the current required by the divider.

    Generally, though, when motor currents of this magnitude are required, it's much more efficient to PWM the motor directly, than to use a linear drive like the ones illustrated here. You have to remember that, even though we've reduced the power dissipation of the resistor by means of in input divider, the transistor needs to dissipate the balance. That will entail a pretty hefty heatsink and a profound loss of efficiency.

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/21/2008 9:41:33 PM GMT
    360 x 300 - 2K
    394 x 300 - 2K
    574 x 300 - 3K
  • grasshoppergrasshopper Posts: 438
    edited 2008-12-21 19:31
    Thanks fellas. I can see some of the differences now.
  • kwinnkwinn Posts: 8,697
    edited 2008-12-22 04:19
    Phil and Tracy have provided an excellent and very clear description of the circuits. However there is one area that, while correct in theory, will cause problems in practice. That is the wattage of the resistors. If you are running a resistor at or very near the maximum rated power for long periods it will burn out, and often bake the circuit board around it. Use resistors with a rating of 1.5 to 2.0 times the expected power dissipation and mount them a couple of millimeters above the board so there is air flow around them.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-12-22 05:05
    kwinn,

    That's excellent advice! Thanks for the correction!

    -Phil
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-12-22 17:32
    Yes, that's good advice. Phil also suggested a circuit refinement to reduce the voltage across the current sensing resistor and thus its power dissipation, and to increase the dynamic range available to the motor.

    How low a resistance to use will be determined in part by the accuracy of the op-amp and by the circuit layout. If you use a 0.5 ohm resistor to sense the current, then it will have 500 millivolts across it and will dissipate 0.5 watt when the output current is one amp. That is such a low resistance that you will have to be sure that the wiring and connections do not introduce additional voltage drops in the measurement. Some older op-amps have offset voltages of several millivolts, so that might be a factor as the sense resistor becomes smaller. Sometimes the op-amp is configured in a differential, Kelvin connected scheme in order to better sense the voltage across the small "shunt" resistor that might be on the order of 50 milliohms for measuring high currents.

    The transistor will dissipate the bulk of the power. Figure if the power supply is 12 volts and if 10 volts is left across the transistor at one amp with the motor stalled, that will be 10 watts burning up in the transistor in the linear control circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-12-22 19:05
    It's weird how Phil and I will come up with very similar designs... He will contest to that over the several PM we have had....

    Originally, I was using this circuit as part of a universal chemistry programmable voltage/current battery charger.

    ...Here is a slight modification to Phil's design that would allow it to work as a simple switch-mode-power-supply as I have been using it. The first stage Op-Amp functions as a buffer to hold a PWM or direct input voltage level. The second stage Op-Amp functions like an adjustable threshold Schmitt trigger governed by the 10K and 1M resistor divider.... the hysteresis introduced by the Schmitt trigger keeps the drive transistor out of it's linear operating region. Designed with the Propeller in mind, this particular circuit allows a 3.3V 0-100% duty cycle to control an output voltage from 0V to about 10.6 volts governed by the 10K and 22K resistor divider giving roughly 3.2 times the PWM voltage. VMaxOut <= (PWM voltage x Duty) x [noparse][[/noparse](10K +22K)/10K] <= Supply Voltage


    The next thing I would do with this circuit would be to remove the PNP transistor and modify the circuit to use a MOSFET, but this change would only be to increase the power transfer efficiency.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 12/23/2008 7:58:58 AM GMT
    1080 x 760 - 334K
Sign In or Register to comment.