Simulating a variable resistance input with LTSpice?

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:

formatting link

It works but is incredibly slow. Any better ideas?

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg
Loading thread data ...

Do you need a voltage to resistance converter? That's easy if you have a multiplier. Interestingly, LT Spice doesn't provide a multiplier component.

John

Reply to
John Larkin

formatting link

Well, the one in the link works now. Turns out one shall not get too close to very low values where LTSpice has a hard time. At least it heats my office :-)

When do we get some global warming out here?

This function stuff is pretty cool. For example, it can be used to get pressure sensor readings from a file into something that electrically resembles the sensor.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

Get this file...

VVR.zip VOLTAGE VARIABLE RESISTOR SYMBOL/SUBCIRCUIT

On the Subcircuits and Symbols Page of my website.

It's just a text file... all you care about is the "Template" line. ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

Joerg a écrit :

formatting link

The way I'd do it is with a B current source (OK, sink). Basically you measure voltage across the NL resistor nodes (a,b) and sink a current between these nodes which is your NL function of V(a,b).

That also better handles the R=0 pathological case, because you're less tempted to allow infinite current flow :-)

--
Thanks,
Fred.
Reply to
Fred Bartoli

formatting link

Thanks, will check it out. Got the circuit pretty much done by now but some day if I get more of those little temp sense projects I want to pour the Steinhart-Hart equation in there. Then I'd have a true temperature-variable resistor. LTSpice has the nice feature of being able to read in a WAV table.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

formatting link

That's a good idea. Right now I map a variable voltage source into a resistor. Works, but leaves one weirdness: kiloohms on the horizontal scale are labeled kilovolts.

I always wondered if there'd be a way to inlude a phssst ... *POOF* function in LTSpice, with audio effects, sirens and all. That would be nice to have during a design review :-)

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

formatting link

Read up on behavioral modeling techniques... lots of simulation power there. ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

formatting link

Some XSPICE simulators allow you to monitor values during simulation and do almost whatever you want. The one I use handles wave files, so maybe :-)

--
Thanks,
Fred.
Reply to
Fred Bartoli

Loosen up them thar spats, the multiplier "element" is "*" :-)

As in...

Emult Outnode1 Outnode2 Value = {(Vinnode1,0)*(Vinnode2,0)}

[Snicker :-] ...Jim Thompson
--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

Sorry, Joerg, I misread your need. It's actually quite simple, IF you can describe the TC with coefficients of T and T^2... make your own resistor model:

Resistor

General form

R [model name]

  • [TC = [,]]

TC1, and TC2 are the linear and squared coefficients, respectively.

See the LTspice manual for clarity (the above was pasted from PSPCREF.pdf) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

"John Larkin" schrieb im Newsbeitrag news: snipped-for-privacy@4ax.com...

Hello John,

LTspice has B-deviecs. They can do a lot of math.

* ** power / divide sin tanh exp

See the help pages for B-devices. The B-device is the best device to implement a NTC-resistor with it's exponential resistance versus temperature function.

The LTspice Yahoo group provides examples.

Best regards, Helmut

Reply to
Helmut Sennewald

formatting link

In the current case it's a whole lot uglier than that, see under "Inverse of the equation":

formatting link

T (Temperature) must be scooted. I think LTSpice will have a cow when I try this.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

Sure, but a canned multiplier component would be handy, without a bunch of typing. As would an ideal diode. At least they have ideal opamps.

John

Reply to
John Larkin

formatting link

Then use a resistance vs temperature table... trivial in PSpice, probably so in LTspice.

Besides, that smells like unnecessary obfuscation :-)

What kind of NTC?

They're usually spec's as R = Ro*e^(beta*(1/T-1/To)) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

Lazy spat wearer, can't even roll his own B-devices ;-) ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

formatting link

Depends on the client, how much precision they want, how much MIPS is there, how much RAM is there.

Just the regular kind, silicon-based resistor.

In industry it's usually the 2-term or the 3-term Steinhart-Hart equation.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

formatting link

There are modulators though, regular and I/Q, under special functions.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.
Reply to
Joerg

Thompson's Fundamental Rule #1, Stay away from PhD's, use this instead....

formatting link

Do you really have one bad enough to need the high order corrections? ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

formatting link

It's "usually" the equation I cited... I have several books here that say so ;-)

And it's trivial to do in Spice. ...Jim Thompson

--
| James E.Thompson, CTO                            |    mens     |
| Analog Innovations, Inc.                         |     et      |
| Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
| Phoenix, Arizona  85048    Skype: Contacts Only  |             |
| Voice:(480)460-2350  Fax: Available upon request |  Brass Rat  |
| E-mail Icon at http://www.analog-innovations.com |    1962     |
             
      The only thing bipartisan in this country is hypocrisy
Reply to
Jim Thompson

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.