Design Ideas: March 3, 1994
Using an ideal Spice current source often results in significant simulation errors, particularly for circuits that include fixed-current loads and constant-current sources. When using a current source as a load, for example, the ideal source in Spice produces whatever voltage is required (positive or negative) to produce the specified current, even if the circuit doesn't have power or its output is off. A load resistor is the safest alternative for a circuit load, but you'll often have to perform several iterations (and put up with a fair amount of aggravation) to adjust the load resistor so that the simulation produces the exact desired value of load current.
The subcircuit in Fig 1 and Listing 1 provides a constant-current load for any specified value of current and suits any application that requires a realistic constant-current source. The subcircuit works by automatically adjusting the value of the current-controlled voltage source, HL, to produce the desired current through the current-sense source, VL. By changing the value of the current source, IX, you can adjust the constant current to any desired value. The subcircuit uses the exponential function in the Spice diode model to produce a smooth, continuous function to limit the voltage produced by HL to a positive value. Unlike the ideal constant-current source, this subcircuit will not produce a negative voltage and, thus, will not continue to draw current when the circuit's supply voltage drops to zero or less.
Simulations using PSpice verified the subcircuit's operation, but the subcircuit will work with all Spice-compatible simulators. The subcircuit's design helps to minimize convergence problems and computation times. The selected subcircuit parameters produce accurate currents of <1 mA to several amps. You can accurately simulate smaller currents by increasing the gain value. EDN BBS /DI_SIG #1382
| Listing 1Constant-current subcircuit |
|---|
.SUBCKT ILOAD 1 2 DL 1 3 DZ HL 3 4 VD 1 VL 4 2 0 DD 10 0 DX HD 10 11 POLY(2) VL VX 0 1MEG -1MEG VD 0 11 0 VX 20 0 0 IX 0 20 10m ; Desired current .MODEL DZ D(IS=1E-9 RS=1m) .MODEL DX D(IS=1E-15) .ENDS |