Current generator: DC analysis fails

domispace
2011-10-08
2012-12-15
  • domispace
    domispace
    2011-10-08

    Hi,

    I'm trying to simulate a current generator using an op amp with a feedback wire between its non-inverting input and a PNP's emitter. But I cannot obtain a perfect DC analysis, the same errors are occuring when the simulation is performed.

    Here is my project's code :

    <Qucs Schematic 0.0.15>
    <Properties>
      <View=0,0,966,680,1,0,0>
      <Grid=10,10,1>
      <DataSet=source_de_courant_constant.dat>
      <DataDisplay=source_de_courant_constant.dpl>
      <OpenDisplay=1>
      <showFrame=0>
      <FrameText0=Titre>
      <FrameText1=Auteur :>
      <FrameText2=Date :>
      <FrameText3=Version :>
    </Properties>
    <Symbol>
    </Symbol>
    <Components>
      <GND * 1 120 330 0 0 0 0>
      <GND * 1 50 230 0 0 0 0>
      <R R1 1 120 240 15 -26 0 1 "4.7 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
      <R R2 1 120 300 15 -26 0 1 "4.7 kOhm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
      <.DC DC1 1 680 10 0 71 0 0 "26.85" 0 "0.001" 0 "1 pA" 0 "1 uV" 0 "no" 0 "150" 0 "no" 0 "none" 0 "CroutLU" 0>
      <OpAmp OP1 1 260 250 -26 -86 1 0 "1e6" 1 "15 V" 0>
      <IProbe Pr2 1 360 250 -26 16 0 0>
      <Vdc V1 1 50 200 18 -26 0 1 "15 V" 1>
      <.SW SW1 1 680 120 0 71 0 0 "DC1" 1 "lin" 1 "r" 1 "0" 1 "1000" 1 "20" 1>
      <_BJT T1 1 550 250 8 -26 1 0 "pnp" 1 "1e-16" 1 "1" 1 "1" 0 "0" 0 "0" 0 "0" 1 "0" 0 "0" 0 "1.5" 0 "0" 0 "2" 0 "100" 1 "1" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0" 0 "0.75" 0 "0.33" 0 "0" 0 "0.75" 0 "0.33" 0 "1.0" 0 "0" 0 "0.75" 0 "0" 0 "0.5" 0 "0.0" 0 "0.0" 0 "0.0" 0 "0.0" 0 "0.0" 0 "26.85" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "1.0" 0 "1.0" 0 "0.0" 0 "0.0" 0 "3.0" 0 "1.11" 0 "26.85" 0 "1.0" 0>
      <GND * 1 550 540 0 0 0 0>
      <R R3 1 550 510 15 -26 0 1 "r" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
      <IProbe Pr1 1 550 410 -41 -26 0 3>
      <R R4 1 550 110 15 -26 0 1 "500 Ohm" 1 "26.85" 0 "0.0" 0 "0.0" 0 "26.85" 0 "european" 0>
    </Components>
    <Wires>
      <120 150 120 210 "" 0 0 0 "">
      <120 270 230 270 "Vplus" 210 240 57 "">
      <50 150 50 170 "" 0 0 0 "">
      <50 150 120 150 "" 0 0 0 "">
      <200 230 230 230 "" 0 0 0 "">
      <200 170 200 230 "" 0 0 0 "">
      <200 170 550 170 "Vmoins" 330 140 107 "">
      <300 250 330 250 "" 0 0 0 "">
      <120 50 120 150 "" 0 0 0 "">
      <390 250 520 250 "" 0 0 0 "">
      <550 440 550 480 "" 0 0 0 "">
      <550 280 550 380 "" 0 0 0 "">
      <550 170 550 220 "" 0 0 0 "">
      <120 50 550 50 "" 0 0 0 "">
      <550 50 550 80 "" 0 0 0 "">
      <550 140 550 170 "" 0 0 0 "">
    </Wires>
    <Diagrams>
    </Diagrams>
    <Paintings>
    </Paintings>

    Can somebody tell me why the errors are occuring ? Note that they don't happen when the feedback is not present.

    Thanks for yours answers !

    Best regards

     
  •  magneto98
    magneto98
    2011-10-08

    Hi domispace

    I don't know the reason for the error exactly. Your simulation works, if you select 'GolubSVD' as solver in the DC simulation block.
    see http://pastebin.com/ec9sJ2Rr

    Nevertheless your circuit is only working for a small load resistance range. (Your are not regulating the load_current, but (load_current + transistor_base_current).
    Maybe you could circumvent this with an other arrangement of shunt resistor and transistor or using a differential opamp or an integrated current sensor to feed back only the  load current to your opamp.
    Be carefull also with oscillations in the control loop. It could be necessary to add an low pass filter e.g. at the output of the opamp.
    You could also try a MOSFET instead of the bipolar transistor.

    Best of luck

    Carsten