Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

4-20mA current loop with common ground

Status
Not open for further replies.
Yes, I think the instability comes from this design not the OPAmp itself. E-design, your last figure doesn't show the loop gain, the DC gain of the open-loop system should be around 100dB for this system. So the phase margin is not that what you show, and probably your simulation is wrong.
1 Opamp is the best, most straightforward solution, I also recommend that.

Well today after work I decided to breadboard (hate these things) the circuit in the lab and test it. When I powered up and checked I could not see any obvious problems. I then simulated the circuit in another more trusted simulator to double check. The latest TINA release has some nasty bugs (often crash when plotting an AC response sweep) that the programmers are trying to sort out. It reported to expect 62 deg phase margin and 11 dB gain margin. I then thought, well, while it is on the bench and the FRA is free to check the actual figures. The FRA plotted 53 deg phase margin (taking into account that phase is a very sensitive measurement) and a corresponding 9.8 dB gain margin. Not bad for a horrible breadboard circuit. It is a bit peaky with square wave inputs but who knows all the effects caused by the breadboard itself.

The crossover is way too high (unless you want to do music) and should be knocked down at least a decade or so. I will play with it a bit more as time permits to see what I can improve.

I also checked the waveforms on our hi-res scope at full bandwidth and they look very clean.

I do like the circuit shown by Klaus!
 

Attachments

  • 4-20_test_cct.jpg
    4-20_test_cct.jpg
    98.9 KB · Views: 155
  • FRA_4_20mA_FRA.png
    FRA_4_20mA_FRA.png
    225.3 KB · Views: 168
  • 4_20_hi_res.png
    4_20_hi_res.png
    52 KB · Views: 153
Here is the final circuit. I rolled off the response around U1 as was also suggested and increased R2 to 75k. All the peaky square wave response vanished as expected. As can be seen that the simulator predicted 108.2 deg phase margin and 11. 4 dB gain margin. The results from the FRA sweep produced almost exactly the same results (108.6 and 11.18).
The crossover predicted was 2.6 kHz and the measured value was just over 2 kHz.

The simulator also predicted distortion under 0.1%, which seems to be confirmed by the FFT measurement display. This means the circuit give very linear current conversion, which may be important for accurate control. The FFT display was actually with the wider bandwidth version before adding the 2.2n.
 

Attachments

  • 4-20_test_cct1.png
    4-20_test_cct1.png
    84.4 KB · Views: 169
  • square.png
    square.png
    72.3 KB · Views: 143
  • dist.png
    dist.png
    72.8 KB · Views: 151
It is nice you changed R2 to 75kOhm. I tried in Tina the circuit when I changed only the R2 to 75kOhm and the PM changed from -23° to +28°. I added the 2.2nF and the PM increased really to 108° by an LHP zero, it is too much a bit.
Also nice that it can work on a breadboard and you proved that. I have to bow.
But still, I don't think it is necessary to use more than 1 Opamp for a simple regulation. There are enough stages in series inside 1 OPAmp and the risk is lower for instability. Consumption also lower for example. I don't see advantages of 2 OPAmp.
 

For accurate control, you'll want to reduce two static error terms

- T1 base current effect. Using a darlington (or MOSFET) pushes it down.
- differential amplifier common mode sensitivity introduced by R1. Increase R7 respectively.

Of course a single OP circuit can be used. Resistor calculation is slightly more complex.
 

It appears that it should be possible to trim out most of the loading and base current errors by adding a error-compensation resistor after the 75k to the diff amp like shown. Linearity or stability is not affected.
 

Attachments

  • error_trim.png
    error_trim.png
    57.1 KB · Views: 165

It is nice you changed R2 to 75kOhm. I tried in Tina the circuit when I changed only the R2 to 75kOhm and the PM changed from -23° to +28°. I added the 2.2nF and the PM increased really to 108° by an LHP zero, it is too much a bit.

Yes, I think the 75 k helped a lot. I found adding a 1n after the 75 k, level out the phase nicely. TINA seems a bit over optimistic on the gain margin (62 dB). Other sim says 44 dB, which I tend to believe a bit more.

Never mind, it looks like yet another bug :x. TINA's automatic PM and GM measurement seems to have a problem. Using the cursors, it measures 46 dB. I am really annoyed with the latest TINA release. They added many features but also a lot of bugs.
You get tired of seeing the message below.
 

Attachments

  • phase_corr.png
    phase_corr.png
    20 KB · Views: 131
  • err.png
    err.png
    19.6 KB · Views: 143

The 1 OPAmp version. Phase margin is 62°, unity gain bandwidth is 500kHz.
<blockquote class="imgur-embed-pub" lang="en" data-id="a/jR4JF"><a href="//imgur.com/jR4JF">V to I converter (1...5V - 4...20mA)</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
<blockquote class="imgur-embed-pub" lang="en" data-id="a/0ZPQu"><a href="//imgur.com/0ZPQu">V to I converter response</a></blockquote><script async src="//s.imgur.com/min/embed.js" charset="utf-8"></script>
Older Tina versions are also bad because of various things, unfortunately I like the GUI and the big model library.
 
Last edited:
Nice circuit! I thought of using a controlled current source using a LM334 or similar but could not find any simulation models for it.

Which version of TINA are you using?
 

Version 6...... But really bad also. Always my circuit is irregular, or I forget to switch off an independent source and it doesn't want to simulate (????Why????), it likes to hide the cursor values because it is fun. Screws me up. Nowadays I use other simulators, I choose Tina only for simple things to simulate fastly.
 

Yep, similar frustrations this side. The best stable version was 10, before they added a lot of new features. Often it will plot graphs on top of each other with no way to separate them. Then when collecting and messing with it, it will crash with illegal operation. Sometimes with an AC sweep it will just not plot anything or crash. It gets worse with the complexity of the circuit. They added a feature "stress analysis" which sounds nice but it will crash a simulation with strange errors. Being just a 32 bit engine cause "out of memory" problems. They are currently working on a 64 bit release.
 

Thanks @KlausST, @E-design and @frankrose for submitting so much info and circuits on my thread! Can't wait to build and test them all.

Now I build the circuit from KlausST, but with a PNP (2N3906) and no zeners because these are the parts I have available right now. The circuit gets driven from a MCP4725 and responds almost linear (almost - maybe because of the base current?).
The problem now is that with my available power supply 24,34V and no input (0V) I have exactly 23V on the base of the transistor which leads to ~7mA current through the load (my multi-meter). With an input shortly above 1V this effect disappears and like I said above the circuit behaves almost linear.

My measurements:
(voltage on the output of the MCP4725 : current measured on load)
0V : 7mA
1V : 7mA
2V : 8,7mA
3V : 13,13mA
4V : 17,5mA
5V : 21,9mA

What could be the reason for this behavior?
 

Hi,

y 24,34V and no input (0V) I have exactly 23V on the base of the transistor which leads to ~7mA current through the load
This is expectable. With the bjt (0.6V thresold voltage) you need an Opamp which output goes close to its positive rail.
With a Mosfet this is not that critical, because they have a much higher threshold voltage.

With the bjt : try to add a resistor from Opamp_output to VCC to drive the output more positive.
Or choose an Opamp with better rail-to-rail-output performance.

Klaus
 
Problem is limited LM358 linear output voltage range. Without zener diode, a 10k pull-up resistor should do the trick.
 
Adding 10k pull-up led to almost perfect response. Thanks again!
 

Here is another circuit (like we don't have enough already), which seems happy operating with either an MOSFET or BJT. It shows no stability problems from simulation results and phase margin stays above 50 deg for a 500 ohm lower (not including the 250 ohm sense resistor) loop resistance and improves rapidly as resistance decreases.

It also has very low distortion (0.0035% predicted at 50 Hz). Crossover frequency varies between 3-4 kHz depending on loop resistance. Gate voltage is never near max limit.

All 47 k and 39 k resistances should be at least 1% tolerance types.
 

Attachments

  • 4_20_fet_bjt_dist.png
    4_20_fet_bjt_dist.png
    18.1 KB · Views: 138
  • 4_20_fet_bjt.png
    4_20_fet_bjt.png
    50.7 KB · Views: 168
I suggest to check also the current source output resistance in simulation. It reveals about 50k output resistance. Unfortunately the provided "20 mA trim" resistor combination doesn't coincide with high output impedance.

See attached a calculation of OP current source dimensioning for infinite output resistance.
 

Attachments

  • OP Current Source.pdf
    114.4 KB · Views: 110
  • Like
Reactions: CataM

    CataM

    Points: 2
    Helpful Answer Positive Rating
I checked my circuit. Rout is 140kOhm at 20mA, 684kOhm at 4mA output current. If it is required use 2n2905 instead of 2n2904, and Rout will go up to 335kOhm at 20mA.
 

I suggest to check also the current source output resistance in simulation. It reveals about 50k output resistance. Unfortunately the provided "20 mA trim" resistor combination doesn't coincide with high output impedance.

See attached a calculation of OP current source dimensioning for infinite output resistance.

Yes, and most probably have used a better opamp with jfet inputs and higher resistances.
 

This is not the first time that LM358 gets mentioned as not being good enough. What would be the better option for this task?
 

Hi,

I try to avoid exact partames.
There are so many Opamps. Each has it's benefits and drawbacks.
And there are "parameters" we don't know or changes with time: like availability and price.

Your distributor should have an interactive selection guide.
Learn to use it.
For "simple" applications you may find hundreds of suitable Opamps. Then choos the one with lowest price or best availability or
For some "sophisticated" applications you may find none ... and you have to look for a compromise.

In this case: "better" is given in post#38: jfet, higher input resistance.
-> easy to find.
For sure you need to look for your application's parameters: power supply range, signal input range, output voltage range....

My recommendation:
Before you buy one, go through the datasheet, "absolute maximum ratings" and "recommended operation parameters" and at least the first couple of lines of the "electrical specifications".
Compare each specification if it fits your application's needs.

Klaus
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top