For the life of me I cannot figure out why this subcircuit file does not work. I tried many combinations of curly braces and no braces, The behavioral current source, B2, will not allow parameters for the first and third arguments of the “limit(x,y,z)” function.
The error message is
Unresolved parameter: “vl” (vl is one of the parameters equal to the constant “-12V”)
Fatal error: Missing expression in B-source B2•X1
The symbol with the subcircut is the only thing on the schematic.
If all the items for the B2 source besides V(4,0) are literal constants, then everything is fine.
I don’t know if this is a bug or a misunderstanding, but it sure seems like there must be some way to make it happy,
I did quite a bit of messing with it, trying to make it work and it turns out I did correct that error. Here is the original which won’t wor because Rpar, Cpar and ic don’t work in QSPICE.
Original from the legacy system
.subckt diffamp 1 2 3 VV=100m Vh=12 Vl=-12 Aol=100K GBW=10Meg Rout=50
.param c=Aol/GBW/6.28318530717959
b1 0 4 i={VV}*tanh(v(2,1)/{VV})*Aol Rpar=1 Cpar={c} ic=0
b2 0 3 i=limit({Vl},v(4),{Vh})/{Rout} Rpar={Rout} cpar=1p ic=0
.ends diffamp
My modifications, with the parameters, mentioned in the comment, attached to the symbol in QSPICE
*
Differential Amplifier ported from a legacy system
I think I know what the problem is. The file I created had UTF-8 as the character type. I can well imagine that would mess things up for both this web application and QTSPICE. Let me try to fix that kerfuffle and I’ll get back to you.
HI Mike,
There is no happiness to report. Here is the original which works in the legacy system as expected.
.subckt diffamp 1 2 3 VV=100m Vh=12 Vl=-12 Aol=100K GBW=10Meg Rout=50
.param c=Aol/GBW/6.28318530717959
b1 0 4 i={VV}*tanh(v(2,1)/{VV})*Aol Rpar=1 Cpar={c} ic=0
b2 0 3 i=limit({Vl},v(4),{Vh})/{Rout} Rpar={Rout} cpar=1p ic=0
.ends diffamp
This was the modification that I made because QSPICE does not appear to support to support Rpar, Cpar, and ic.
Differential Amplifier ported from a legacy system
Uses explicit parallel capacitance and reisistance
I’m still getting the following error(s)
Ignoring shorted resistor: “RI•X2”
Unresolved parameter: “vl”
Fatal error: Missing expression in B-source B2•X2