As I work my way to a Universal OpAmp Spice Model that you only have to feed the subcircuit 10-12 numbers from the datasheet, I observe that LTspice struggles with what I would consider ordinary hyperbolic functions (bounded, all derivatives exist, are finite, and continuous)... making a straight line out of a transfer curve with soft limiting on each end... and churning... churning... churning... mid-range. Experimenting I find that setting Tools/Control Panel/Spice to "Alternate Solver" makes it all work properly. I'd recommend using the Alternate Solver for any circuit that LTspice struggles with, or in my particular case, produces phony output results... in fact I'd recommend Alternate Solver always. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

# LTspice Tip

Started by ●October 22, 2015

Reply by ●October 22, 20152015-10-22

On 10/22/2015 11:44 AM, Jim Thompson wrote:> As I work my way to a Universal OpAmp Spice Model that you only have > to feed the subcircuit 10-12 numbers from the datasheet, I observe > that LTspice struggles with what I would consider ordinary hyperbolic > functions (bounded, all derivatives exist, are finite, and > continuous)... making a straight line out of a transfer curve with > soft limiting on each end... and churning... churning... churning... > mid-range. > > Experimenting I find that setting Tools/Control Panel/Spice to > "Alternate Solver" makes it all work properly. > > I'd recommend using the Alternate Solver for any circuit that LTspice > struggles with, or in my particular case, produces phony output > results... in fact I'd recommend Alternate Solver always. > > ...Jim Thompson >The LTspice sw statement has smooth turn-on and turn-off if you specify negative hysteresis. It's pretty slick actually. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

Reply by ●October 22, 20152015-10-22

On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:>On 10/22/2015 11:44 AM, Jim Thompson wrote: >> As I work my way to a Universal OpAmp Spice Model that you only have >> to feed the subcircuit 10-12 numbers from the datasheet, I observe >> that LTspice struggles with what I would consider ordinary hyperbolic >> functions (bounded, all derivatives exist, are finite, and >> continuous)... making a straight line out of a transfer curve with >> soft limiting on each end... and churning... churning... churning... >> mid-range. >> >> Experimenting I find that setting Tools/Control Panel/Spice to >> "Alternate Solver" makes it all work properly. >> >> I'd recommend using the Alternate Solver for any circuit that LTspice >> struggles with, or in my particular case, produces phony output >> results... in fact I'd recommend Alternate Solver always. >> >> ...Jim Thompson >> > >The LTspice sw statement has smooth turn-on and turn-off if you specify >negative hysteresis. It's pretty slick actually. > >Cheers > >Phil HobbsWhat does that have to do with the Alternate Solver? ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply by ●October 22, 20152015-10-22

On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:>On 10/22/2015 11:44 AM, Jim Thompson wrote: >> As I work my way to a Universal OpAmp Spice Model that you only have >> to feed the subcircuit 10-12 numbers from the datasheet, I observe >> that LTspice struggles with what I would consider ordinary hyperbolic >> functions (bounded, all derivatives exist, are finite, and >> continuous)... making a straight line out of a transfer curve with >> soft limiting on each end... and churning... churning... churning... >> mid-range. >> >> Experimenting I find that setting Tools/Control Panel/Spice to >> "Alternate Solver" makes it all work properly. >> >> I'd recommend using the Alternate Solver for any circuit that LTspice >> struggles with, or in my particular case, produces phony output >> results... in fact I'd recommend Alternate Solver always. >> >> ...Jim Thompson >> > >The LTspice sw statement has smooth turn-on and turn-off if you specify >negative hysteresis. It's pretty slick actually. > >Cheers > >Phil HobbsThe resistance changes continuously? Who knew?!! That could be useful. I sometimes use mosfets and voltage-source gate drivers, because the switch closes infinitely fast and can do nasty things. It would be nice to have R = f(t)

Reply by ●October 22, 20152015-10-22

On 10/22/2015 01:02 PM, Jim Thompson wrote:> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs > <pcdhSpamMeSenseless@electrooptical.net> wrote: > >> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>> As I work my way to a Universal OpAmp Spice Model that you only have >>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>> that LTspice struggles with what I would consider ordinary hyperbolic >>> functions (bounded, all derivatives exist, are finite, and >>> continuous)... making a straight line out of a transfer curve with >>> soft limiting on each end... and churning... churning... churning... >>> mid-range. >>> >>> Experimenting I find that setting Tools/Control Panel/Spice to >>> "Alternate Solver" makes it all work properly. >>> >>> I'd recommend using the Alternate Solver for any circuit that LTspice >>> struggles with, or in my particular case, produces phony output >>> results... in fact I'd recommend Alternate Solver always. >>> >>> ...Jim Thompson >>> >> >> The LTspice sw statement has smooth turn-on and turn-off if you specify >> negative hysteresis. It's pretty slick actually. >> >> Cheers >> >> Phil Hobbs > > What does that have to do with the Alternate Solver? > > ...Jim Thompson >Since it's a built-in function, it's pretty well guaranteed to work in LTspice's normal solver. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

Reply by ●October 22, 20152015-10-22

On 10/22/2015 01:05 PM, John Larkin wrote:> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs > <pcdhSpamMeSenseless@electrooptical.net> wrote: > >> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>> As I work my way to a Universal OpAmp Spice Model that you only have >>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>> that LTspice struggles with what I would consider ordinary hyperbolic >>> functions (bounded, all derivatives exist, are finite, and >>> continuous)... making a straight line out of a transfer curve with >>> soft limiting on each end... and churning... churning... churning... >>> mid-range. >>> >>> Experimenting I find that setting Tools/Control Panel/Spice to >>> "Alternate Solver" makes it all work properly. >>> >>> I'd recommend using the Alternate Solver for any circuit that LTspice >>> struggles with, or in my particular case, produces phony output >>> results... in fact I'd recommend Alternate Solver always. >>> >>> ...Jim Thompson >>> >> >> The LTspice sw statement has smooth turn-on and turn-off if you specify >> negative hysteresis. It's pretty slick actually. >> >> Cheers >> >> Phil Hobbs > > The resistance changes continuously? Who knew?!! > > That could be useful. I sometimes use mosfets and voltage-source gate > drivers, because the switch closes infinitely fast and can do nasty > things. > > It would be nice to have R = f(t) > >You could use Joerg's MOSFET linearization trick, i.e. use two matched voltage-controlled switches and apply feedback around one to set the resistance of both. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

Reply by ●October 22, 20152015-10-22

On Thu, 22 Oct 2015 13:24:08 -0400, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:>On 10/22/2015 01:02 PM, Jim Thompson wrote: >> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs >> <pcdhSpamMeSenseless@electrooptical.net> wrote: >> >>> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>>> As I work my way to a Universal OpAmp Spice Model that you only have >>>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>>> that LTspice struggles with what I would consider ordinary hyperbolic >>>> functions (bounded, all derivatives exist, are finite, and >>>> continuous)... making a straight line out of a transfer curve with >>>> soft limiting on each end... and churning... churning... churning... >>>> mid-range. >>>> >>>> Experimenting I find that setting Tools/Control Panel/Spice to >>>> "Alternate Solver" makes it all work properly. >>>> >>>> I'd recommend using the Alternate Solver for any circuit that LTspice >>>> struggles with, or in my particular case, produces phony output >>>> results... in fact I'd recommend Alternate Solver always. >>>> >>>> ...Jim Thompson >>>> >>> >>> The LTspice sw statement has smooth turn-on and turn-off if you specify >>> negative hysteresis. It's pretty slick actually. >>> >>> Cheers >>> >>> Phil Hobbs >> >> What does that have to do with the Alternate Solver? >> >> ...Jim Thompson >> >Since it's a built-in function, it's pretty well guaranteed to work in >LTspice's normal solver. > >Cheers > >Phil HobbsOf course... built-in functions always work, but models devised on other Spice variants platforms often hang... unless you use the Alternate Solver. I can't see that there's any significant speed penalty by using the Alternate Solver, especially on a fast multi-core machine. ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply by ●October 22, 20152015-10-22

On Thu, 22 Oct 2015 13:29:48 -0400, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:>On 10/22/2015 01:05 PM, John Larkin wrote: >> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs >> <pcdhSpamMeSenseless@electrooptical.net> wrote: >> >>> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>>> As I work my way to a Universal OpAmp Spice Model that you only have >>>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>>> that LTspice struggles with what I would consider ordinary hyperbolic >>>> functions (bounded, all derivatives exist, are finite, and >>>> continuous)... making a straight line out of a transfer curve with >>>> soft limiting on each end... and churning... churning... churning... >>>> mid-range. >>>> >>>> Experimenting I find that setting Tools/Control Panel/Spice to >>>> "Alternate Solver" makes it all work properly. >>>> >>>> I'd recommend using the Alternate Solver for any circuit that LTspice >>>> struggles with, or in my particular case, produces phony output >>>> results... in fact I'd recommend Alternate Solver always. >>>> >>>> ...Jim Thompson >>>> >>> >>> The LTspice sw statement has smooth turn-on and turn-off if you specify >>> negative hysteresis. It's pretty slick actually. >>> >>> Cheers >>> >>> Phil Hobbs >> >> The resistance changes continuously? Who knew?!! >> >> That could be useful. I sometimes use mosfets and voltage-source gate >> drivers, because the switch closes infinitely fast and can do nasty >> things. >> >> It would be nice to have R = f(t) >> >> >You could use Joerg's MOSFET linearization trick, i.e. use two matched >voltage-controlled switches and apply feedback around one to set the >resistance of both.Just a not-instant-turnon switch would be useful. I'll play with the negative-hysteresis thing.> >Cheers > >Phil HobbsBack in ancient times, I used to run ECA, a non-Spice-based DOS text-netlist circuit simulator. It let you express anything (R, L, C, V, I) as an expression of anything else. That was handy. It always converged, too. It would occasionally complain about a divide-by-zero event, but you could ignore them; it kept going. -- John Larkin Highland Technology, Inc picosecond timing precision measurement jlarkin att highlandtechnology dott com http://www.highlandtechnology.com

Reply by ●October 23, 20152015-10-23

On Thu, 22 Oct 2015 13:29:48 -0400, Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> wrote:>On 10/22/2015 01:05 PM, John Larkin wrote: >> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs >> <pcdhSpamMeSenseless@electrooptical.net> wrote: >> >>> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>>> As I work my way to a Universal OpAmp Spice Model that you only have >>>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>>> that LTspice struggles with what I would consider ordinary hyperbolic >>>> functions (bounded, all derivatives exist, are finite, and >>>> continuous)... making a straight line out of a transfer curve with >>>> soft limiting on each end... and churning... churning... churning... >>>> mid-range. >>>> >>>> Experimenting I find that setting Tools/Control Panel/Spice to >>>> "Alternate Solver" makes it all work properly. >>>> >>>> I'd recommend using the Alternate Solver for any circuit that LTspice >>>> struggles with, or in my particular case, produces phony output >>>> results... in fact I'd recommend Alternate Solver always. >>>> >>>> ...Jim Thompson >>>> >>> >>> The LTspice sw statement has smooth turn-on and turn-off if you specify >>> negative hysteresis. It's pretty slick actually. >>> >>> Cheers >>> >>> Phil Hobbs >> >> The resistance changes continuously? Who knew?!! >> >> That could be useful. I sometimes use mosfets and voltage-source gate >> drivers, because the switch closes infinitely fast and can do nasty >> things. >> >> It would be nice to have R = f(t) >> >> >You could use Joerg's MOSFET linearization trick, i.e. use two matched >voltage-controlled switches and apply feedback around one to set the >resistance of both. > >Cheers > >Phil HobbsHere's the soft switch: Version 4 SHEET 1 880 712 WIRE -576 240 -768 240 WIRE -496 240 -576 240 WIRE -768 352 -768 240 WIRE -944 368 -1008 368 WIRE -816 368 -944 368 WIRE -496 384 -496 240 WIRE -816 416 -880 416 WIRE -880 480 -880 416 WIRE -1008 512 -1008 368 WIRE -768 512 -768 432 WIRE -1008 640 -1008 592 WIRE -768 640 -768 592 WIRE -496 640 -496 464 FLAG -768 640 0 FLAG -880 480 0 FLAG -1008 640 0 FLAG -496 640 0 FLAG -944 368 R FLAG -576 240 W SYMBOL voltage -768 496 R0 WINDOW 0 58 37 Left 2 WINDOW 3 65 74 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL sw -768 448 M180 WINDOW 0 56 26 Left 2 WINDOW 3 51 65 Left 2 SYMATTR InstName S1 SYMATTR Value SWX SYMBOL voltage -1008 496 R0 WINDOW 0 -86 58 Left 2 WINDOW 3 -282 115 Left 2 WINDOW 123 0 0 Left 2 WINDOW 39 0 0 Left 2 SYMATTR InstName V4 SYMATTR Value PULSE(0 1 1u 1u 1u 1u) SYMBOL res -512 368 R0 WINDOW 0 66 40 Left 2 WINDOW 3 74 76 Left 2 SYMATTR InstName R1 SYMATTR Value 1 TEXT -312 456 Left 2 !.tran 0 5u 0 1n TEXT -320 408 Left 2 ;JL Oct 22, 2015 TEXT -1248 288 Left 2 !.model SWX SW(VT=0.5 Ron=1u Vh=-1) TEXT -296 368 Left 2 ;Soft Switch

Reply by ●October 23, 20152015-10-23

On 10/23/2015 12:07 AM, John Larkin wrote:> On Thu, 22 Oct 2015 13:29:48 -0400, Phil Hobbs > <pcdhSpamMeSenseless@electrooptical.net> wrote: > >> On 10/22/2015 01:05 PM, John Larkin wrote: >>> On Thu, 22 Oct 2015 12:59:57 -0400, Phil Hobbs >>> <pcdhSpamMeSenseless@electrooptical.net> wrote: >>> >>>> On 10/22/2015 11:44 AM, Jim Thompson wrote: >>>>> As I work my way to a Universal OpAmp Spice Model that you only have >>>>> to feed the subcircuit 10-12 numbers from the datasheet, I observe >>>>> that LTspice struggles with what I would consider ordinary hyperbolic >>>>> functions (bounded, all derivatives exist, are finite, and >>>>> continuous)... making a straight line out of a transfer curve with >>>>> soft limiting on each end... and churning... churning... churning... >>>>> mid-range. >>>>> >>>>> Experimenting I find that setting Tools/Control Panel/Spice to >>>>> "Alternate Solver" makes it all work properly. >>>>> >>>>> I'd recommend using the Alternate Solver for any circuit that LTspice >>>>> struggles with, or in my particular case, produces phony output >>>>> results... in fact I'd recommend Alternate Solver always. >>>>> >>>>> ...Jim Thompson >>>>> >>>> >>>> The LTspice sw statement has smooth turn-on and turn-off if you specify >>>> negative hysteresis. It's pretty slick actually. >>>> >>>> Cheers >>>> >>>> Phil Hobbs >>> >>> The resistance changes continuously? Who knew?!! >>> >>> That could be useful. I sometimes use mosfets and voltage-source gate >>> drivers, because the switch closes infinitely fast and can do nasty >>> things. >>> >>> It would be nice to have R = f(t) >>> >>> >> You could use Joerg's MOSFET linearization trick, i.e. use two matched >> voltage-controlled switches and apply feedback around one to set the >> resistance of both.Saves contact arcing, too. ;) Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net