A minimal patch for OPAx333.lib to work in Qspice would be
- E_E4 N3116457 MID CL_CLAMP MID 1
+ E_E4 N3116457 MID CL_CLAMP MID 0.99; need loop gain < 1
- S_S1 3 4 1 2 _S1
+ S_S1 3 4 1 2 _S1 OFF
= RS_S1 1 2 1G
- .MODEL _S1 VSWITCH ROFF=1E9 RON=10M VOFF=0.0V VON=10MV
+ .MODEL _S1 VSWITCH ROFF=1E9 RON=1 VOFF=0.0V VON=0
- S_S2 3 4 1 2 _S2
+ S_S2 3 4 1 2 _S2 OFF
= RS_S2 1 2 1G
- .MODEL _S2 VSWITCH ROFF=1E9 RON=10M VOFF=0.0V VON=10MV
+ .MODEL _S2 VSWITCH ROFF=1E9 RON=1 VOFF=0.0V VON=0
Cutting the gain below 1.0 in the feedback loop, that can be formed when the output stage goes beyond the rails, removes the unreasonable high-voltage candidates for the initial operating point.
Declaring the BLOCK_DC
switches to start in the ‘off’ state, solves the some cases where Qspice could not find any initial condition. (This might be redundant to reducing the gain but reducing the gain makes sense on its own.) VSWITCH
is a Pspice feature, and Pspice does not document the ‘off’ flag so I’m not sure if this would cause a warning back in Pspice.
I think the .model
for those switches should have been fine, based on the documentation for the various SPICEs. In fact, Pspice warns against making 'Von ’ and ‘Voff’ too close.
But here the control-voltages are tapped from the terminals of the switch itself, making a 2-terminal device like an ideal diode, and making Von = Voff creates a device with a simple piece-wise linear I-V curve. This avoids the “timestep too small” problem, so far as I have found, when Qspice comes to opening these switches.