Hello Folks,
Got stuck when trying to simulate an NTC. This temperature-variant
resistor will be the only variable input so ".STEP" and stuff do not cut
it because that only overlays multiple curve in an AC or DC simulation.
I want just one curve: Output of my circuit versus varying NTC resistor
value.
Tried to make a voltage dependent resistor this way:
http://www.electro-tech-online.com/...9571000-sine-variable-resistor-ltspice-d2.png
It works but is incredibly slow. Any better ideas?
Here's a couple NTC subcircuits I made up for PSpice. LTspice is
compatible with PSpice syntax, so these should work. These respond to
the temperature parameter in Spice. Easiest to use the Beta equation
approximation, but Steinhart-Hart equation is a bit more accurate.
**************************************************
* NTC resistor using the Beta equation: *
* R = Ro * EXP(B*(1/T - 1/298.15)) *
* Requires resistor value at 25 deg C and Beta *
* which can be set in this subcircuit or passed *
* thru the X instantiation. e.g. *
* X1 1 0 THERMISTORntcB PARAMS: Ro=100k B=4300 *
* Schematics component: RntcB *
* By: Mark 26 March 2003 *
**************************************************
* +------------------- NTC resistor terminals
* |
* | +-------- Resistance at 25 deg C
* | | +- Beta value
..SUBCKT THERMISTORntcB 1 2 PARAMS: Ro=10k B=4300
ETHERM 1 3 VALUE={ I(VSENSE)*Ro*EXP(B*(1/(TEMP+273.15)-1/298.15)) }
VSENSE 3 2 DC 0
..ENDS THERMISTORntcB
*********************************************************
* NTC resistor using the Steinhart-Hart equation: *
* 1/T = A + B*ln(R) + C*ln(R)**3 (ugly solution for R) *
* Requires equation coefficients which can be *
* set in this subcircuit or passed thru the *
* X instantiation. e.g. *
* X1 1 0 THERMISTORntcS PARAMS: A=8.215E-4 B=2.111E-4 C=6.716E-8 *
* See Thermistor_Calculator.mcd for coefficient gen *
* Schematics component: RntcS *
* By: Mark 26 March 2003 *
*********************************************************
* +-------------------NTC resistor terminals
* | +------+------+- equation coeffs
coefficients
..SUBCKT THERMISTORntcS 1 2 PARAMS: A=8E-4 B=2E-4 C=7E-8
.PARAM D={ ((1/(TEMP+273.15))-A)/(2*C) }
.PARAM E={ (B/(3*C))**3 }
.PARAM F={ SQRT(D**2+E) }
.PARAM G={ EXP(PWRS(D-F,1/3)+PWRS(D+F,1/3)) }
ETHERM 1 3 VALUE={ I(VSENSE)*G }
VSENSE 3 2 DC 0
..ENDS THERMISTORntcS
Regards,
Mark