Op amp current source -- Feedback stability issues.

Thread Starter

m121212

Joined Jul 24, 2011
102
Hello,
I am working on a current source with some stability problems. I played around a bit with bode analysis and also some of the standard techniques of adding zeros in the feedback path, but to be honest I am not well enough versed in control theory to get a good resolution.

On the PCB If I decrease the gain of the error amplifier to 100 or 10 that helps but doesn't entirely solve the issue.

In real life the amp is an OPA313, but for the sim I changed it to a generic one for convergence issues.
current_source3a.png
 

Attachments

ronsimpson

Joined Oct 7, 2019
4,667
Is the load R_DMM1? Does it have to be on ground? Can I turn the entire circuit upside down and put it on VCMP? This change will reduce the number of parts greatly.

Part of the instability is Q1 has too much voltage gain. I could add an emitter resistor.
 

Thread Starter

m121212

Joined Jul 24, 2011
102
Is the load R_DMM1? Does it have to be on ground? Can I turn the entire circuit upside down and put it on VCMP? This change will reduce the number of parts greatly.

Part of the instability is Q1 has too much voltage gain. I could add an emitter resistor.
Load is R_DMM which is just a fluke DMM in mA sense mode.

The PCB is already established, so I am hoping I can fix with minimal cut and jumpering, rather than change up the whole design... So in that sense I don't want to flip things.

The Q1 pre-bias values are 10k into base and 10k base to emitter.
 

crutschow

Joined Mar 14, 2008
38,435
The PCB is already established,
So why did you build a PCB for a circuit that doesn't work properly?

You do not need Q1, as it's just adding loop gain which increases the instability problem.

To add an inversion without it, just reverse the inputs to U1.

(And please don't refer to a transistor as a tranny. :rolleyes: Is this an automobile?)
 

schmitt trigger

Joined Jul 12, 2010
2,058
I believe I understand the reason of using a transistor following the error amp’s output, but no emitter-degeneration resistor?
And why a pre-biased transistor in the first place?
 

schmitt trigger

Joined Jul 12, 2010
2,058
No, because I don’t know the value of VCMP. If it is too high, the opamp may not be able to fully turn off the Mosfet and perhaps even be damaged.

I have learned to be cautious with my replies when presented with incomplete information
 

crutschow

Joined Mar 14, 2008
38,435
I don’t know the value of VCMP.
Okay, so the transistor is used to generate a voltage higher than U1 (which is shown with 3.3V supply in the sim) can to turn off the MOSFET.
But as noted, an emitter resistor should be added so its gain is no more than required for the output to generate the required voltages.
 

Thread Starter

m121212

Joined Jul 24, 2011
102
Thanks for your comments. There were some questions that I think were answered, but if not let me know.
I always learn something new here, even something that seems basic. Emitter resistor seems like a good idea.
I'm noodling around with the bode plot to see if the resistor produces a better result. I read that a phase margin of 90 is stable but will have poor "dynamic performance". That sems to be what I have at the moment.

1720839027863.png
 

Ian0

Joined Aug 7, 2020
13,123
C2 is your biggest problem, creating phase shift inside the feedback loop.
Does it all have to be so complicated? You have a four-stage system. Each stage can contribute 90° of phase shift, At 180° it oscillates (unless you make sure that the loop gains is less than 1)
Why do you need a current shunt amplifier? Why not use the op-amp to sense the voltage across the shunt? Can the shunt be a larger value which would make that easier? Why do you need the intermediate transistor? Why not drive the MOSFET with the op-amp?
If you want to make a circuit unstable, make it complicated!
Screenshot from 2024-07-13 06-41-30.png
[Edit] note that MOSFET is drawn upside down.
 
Last edited:

sarahMCML

Joined May 11, 2019
696
C2 is your biggest problem, creating phase shift inside the feedback loop.
Does it all have to be so complicated? You have a four-stage system. Each stage can contribute 90° of phase shift, At 180° it oscillates (unless you make sure that the loop gains is less than 1)
Why do you need a current shunt amplifier? Why not use the op-amp to sense the voltage across the shunt? Can the shunt be a larger value which would make that easier? Why do you need the intermediate transistor? Why not drive the MOSFET with the op-amp?
If you want to make a circuit unstable, make it complicated!
View attachment 326855
Ian, your MOSFET is upside down!
 

Ian0

Joined Aug 7, 2020
13,123
Ian, your MOSFET is upside down!
You are perfectly correct. I forget that SPICE always adds a P-channel MOSFET with its source at the bottom, when you always need it with the source at the top.
I didn't save the SPICE circuit, so it will have to stay upside down.
 

sarahMCML

Joined May 11, 2019
696
You are perfectly correct. I forget that SPICE always adds a P-channel MOSFET with its source at the bottom, when you always need it with the source at the top.
I didn't save the SPICE circuit, so it will have to stay upside down.
I knew that you'd catch it! What a strange quirk for a simulator to have in this day and age.
 

Ian0

Joined Aug 7, 2020
13,123
I knew that you'd catch it! What a strange quirk for a simulator to have in this day and age.
I think it's just because all devices are drawn with the source/emitter/cathode at the bottom, with no thought given to how they will be required in the circuit.
Also, I've just downloaded the latest SPICE and all the icons have been changed, and that's enough to deal with for now!
 

Ian0

Joined Aug 7, 2020
13,123
With some further information from the TS about whether the control signal must be reference to ground, and whether the load must be connected to ground it would be possible to find the easiest solution.
 
Top