Log sweeping a current with SPICE.

Feb 27, 2019 42 Replies

I haven't found a SPICE that allows for Log sweeping. To make wide-range BJT beta-vs-IC and Gummel plots, I did the following:


  1. DC sweep with equal voltage steps, e.g. 0 to 20 volts, 0.2-volt steps.
  2. Linear EXP function subcircuit.
  3. Voltage-controlled current source, with severe attenuation, 1E-10 * At this point we have a super-wide-range log sweep of base current.
  4. Small series resistor to BJT base, with current and voltage probes.
  5. BJT emitter to GND.
  6. Series resistor from BJT collector to +5V supply, with current probe.


  1. Run, gather a set of base and collector currents, add to spreadsheet.



  1. Data probably covers over 10 decades. Take ratio Ic/Ib = beta.
  2. Gummel plot: Ic and Ib traces vs Vbe.
  3. Beta plot: beta vs collector current, Ic from 1uA to 10A.

Make changes to BJT SPICE model parameters, etc., goto step 7.



Thanks, - Win

It would be more interesting to measure the relationship on several samples. I'm sure it would change with different samples and different temperatures.

For this reason, circuits that depend on beta are frowned on.

Although I applaud your interest in SPICE, I'm not sure a model would hold over such a wide range. I use LTspice to investigate new ideas, then prove them on the bench. Some effects are difficult to model, such as parasitic oscillations, noise, jitter, flicker, and so on. Some circuits are more susceptible to unwanted side effects than others. A good circuit should suppress these side effects.

I agree, for the most part.

I am not a big SPICE fan, but I often use it to explore, when analytical analysis is impractical. In that case I insist that my SPICE models match my device's bench measurements. If I use a two-channel SMU, I quickly get measurements over a wide current range. The trick is to get SPICE to let me quickly analyze this.

Thanks, - Win

What is a two-channel SMU and what does it do? Can you show us the .ASC file?

.step dec param doesn't do it?

Cheers

Phil Hobbs

I like to do 1-second (or whatever) transient sweeps. Use the TIME variable in an equation (or even charge a cap from a current source) to make a linear sweep into a BV or BI source. Make everything a function of time, and keep all the math and the graphing in LT Spice.

BV blocks can also compute results, like power dissipation or the log of something, and convert that to a plottable voltage.

Well, I don't like spreadsheets.

John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com

Source Measurement Unit. A benchtop instrument.

They tend to be expensive. Somebody should do a cheap one.

Don't buy the Keithley.

John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com

I own four different types of Keithley models. Paul bought an Agilent model. I greatly prefer mine.

Thanks, - Win

I know we can do log frequency stepping, but can we do log voltage or current stepping?

Thanks, - Win

.

Not sure I understand your question. In the SIMULATE tab, you have EDIT SIM ULATION COMMAND, and from there you you select, DC SWEEP within which you s elect DC SOURCE, TYPE OF SWEEP, giving you a choice of LINEAR, OCTAVE, DECA DE and LIST, with START, STOP and INCREMENT. Then just PROBE the variables in your circuit you will need to perform your beta calculations or whatever s. Then you do that crazy quasi C-commands (not fully documented) on your d ata set for graphing.

Yes, see my previous post.

Is this LTSpice you're talking about?

Thanks, - Win

Thanks. It should be simple with a PIC or AVR and some ADC's. Not everyone needs 21 bits, most time 8 bits will do fine. But if you need 21, it's there.

Real cheap.

We have a high EMI environment that really messed up a Keithley. I sent it back.

formatting link

That error was from grabbing one of the insulated leads.

John Larkin Highland Technology, Inc lunatic fringe electronics

Yep. If you're using some other kind of SPICE, then use the .DC command line LTSpice builds with its menu system, command is shown in box to be placed on schematic, in whatever SPICE you are using.

You can get an HP 4145B for fairly cheap--it goes from femtoamps to hundreds of milliamps. Nice box if you can keep the floppy disk running. (Pro tip: if the disk gets stuck, DON'T PULL IT OUT--disassemble the drive instead.)

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com

Sure.

Log current stepping:

.step dec param I1 1p 100m 3

will get you an 11-decade sweep with three points per decade. Then just use a current source with value {I1} and simulation command '.op'. (See below).

Cheers

Phil Hobbs

Version 4 SHEET 1 880 680 WIRE 96 128 32 128 WIRE 32 144 32 128 WIRE 96 160 96 128 WIRE 32 240 32 224 WIRE 96 240 32 240 WIRE 96 272 96 240 FLAG 96 272 0 SYMBOL current 96 160 R0 SYMATTR InstName I1 SYMATTR Value {I1} SYMBOL res 48 128 M0 SYMATTR InstName R1 SYMATTR Value 1 TEXT -72 64 Left 2 !.step dec param I1 1p 100m 3 TEXT 440 168 Left 2 !.op

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC / Hobbs ElectroOptics Optics, Electro-optics, Photonics, Analog Electronics Briarcliff Manor NY 10510 http://electrooptical.net http://hobbs-eo.com

Can you not use the Arbitrary Behavioral Voltage/Current source?

.step is a repeated analysis stepping, not sweeping the parameter. It is no t the same as sweeping a source. For that he wants. .dc dec I1 100p 100m 10 which DC sweeps current I1 logarithmically from 100pA to 100mA with 10 ste ps per decade. This generates a single curve. Your ridiculous command would produce a gazillion curves.

I bought and returned a 2401. Maybe they fixed it, or other models don't have that EMI sensitivity.

People here like the Agilents, mostly in automated test stands. I found the front panel to be a bit confusing, but we don't use it that way much.

I've thought about designing a multi-channel SMU, and it wouldn't be easy. Each channel should ideally be isolated, quiet, accurate sourcing and measuring to pA and uV, have low capacitance to ground, and be a good wideband high impedance in current mode.

John Larkin Highland Technology, Inc lunatic fringe electronics

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required