[sdiy] LTSpice macromodell help

Harry Bissell harrybissell at wowway.com
Thu Apr 14 16:53:45 CEST 2011


LTspice allows this.  It takes me a little while to nail the syntax, I'm not adept at it yet. In some cases I have
a whole pile of nested brackets to that I'm sure of what I'm asking...

H^) harry



----- Original Message -----
From: Phil Macphail <phil.macphail at liivatera.com>
To: Harry Bissell <harrybissell at wowway.com>
Cc: tim102 at tstinchcombe.freeserve.co.uk, synthdiy <synth-diy at dropmix.xs4all.nl>
Sent: Thu, 14 Apr 2011 10:29:31 -0400 (EDT)
Subject: Re: [sdiy] LTSpice macromodell help


Hi Harry,
I use a different Spice simulator, but for a comparator that switches between the rails, I would let the output voltage be Vsupply*tanh(1000*Vin). The 1000*Vin gives the gain, and the tanh limits the output range. Multiplying by Vsupply gives the output swing. Of course you can add offsets and change the swing range, but that is easy enough.
As you have discovered, you want to keep any voltages/ currents under control before they ‘get to’ any other components, otherwise you may see rather long simulation times. Is it possible to do this kind of behavioral processing in LTspice?
The ideal solution for this example would be to use verilog-A – is there a hobbyist simulator that offers this?

Phil

On 14 Apr 2011, at 15:03, Harry Bissell <harrybissell at wowway.com> wrote:

> I'm trying to make a perfect comparator. So I have a voltage-controlled voltage source
> with a gain of 1e6, followed by a clamp.  The diodes and voltage sources didn't work too well,
> the currents become astronomical. The diode thing works real well at ot near the supply rails, though.
> 
> Thanks for the article, its a good read.
> 
> H^) harry
> 
> 
> 
> ----- Original Message -----
> From: Tim Stinchcombe <tim102 at tstinchcombe.freeserve.co.uk>
> To: 'Harry Bissell' <harrybissell at wowway.com>, 'synthdiy' <synth-diy at dropmix.xs4all.nl>
> Sent: Wed, 13 Apr 2011 17:32:05 -0400 (EDT)
> Subject: RE: [sdiy] LTSpice macromodell help
> 
> Darn! Seconds after I hit the 'send' button I re-read your message and
> realized that article probably _doesn't_ do what you were asking!
> 
> So, I pulled Connelly & Choi off the shelf, and sure enough they use the
> diodes+voltage sources method in their op amp macromodel, using a very ideal
> diode model:
> 
> .model dx d (n=.001)
> 
> and then diodes using 'dx' to clamp to the positive and negative rail
> respectively. (Hopefully this makes sense this time...).
> 
> Tim
> __________________________________________________________
> Tim Stinchcombe 
> 
> Cheltenham, Glos, UK
> email: tim102 at tstinchcombe.freeserve.co.uk
> www.timstinchcombe.co.uk
> 
> 
>> -----Original Message-----
>> From: Tim Stinchcombe [mailto:tim102 at tstinchcombe.freeserve.co.uk] 
>> Sent: 13 April 2011 22:22
>> To: 'Harry Bissell'; 'synthdiy'
>> Subject: RE: [sdiy] LTSpice macromodell help
>> 
>> 
>> As well as tanh already suggested, I think the 'arctan' 
>> expression used in this nice little article does the job 
>> tolerably well too:
>> 
>> <http://www.edn.com/article/493732-Modular_macromodeling_techn
> iques_for_Spice_simulators.php>
> 
> PDF version:
> 
> http://www.edn.com/contents/images/198891.pdf
> 
> Tim
> __________________________________________________________
> Tim Stinchcombe 
> 
> Cheltenham, Glos, UK
> email: tim102 at tstinchcombe.freeserve.co.uk
> www.timstinchcombe.co.uk
> 
> 
>> -----Original Message-----
>> From: synth-diy-bounces at dropmix.xs4all.nl
>> [mailto:synth-diy-bounces at dropmix.xs4all.nl] On Behalf Of 
>> Harry Bissell
>> Sent: 13 April 2011 16:48
>> To: synthdiy
>> Subject: [sdiy] LTSpice macromodell help
>> 
>> 
>> 
>> Hi all... yes its synth-related
>> 
>> I'm trying to come up with a macromodel of a voltage limiter
>> circuit. Electronic Workbench includes such a device, LTspice 
>> does not.
>> 
>> The object would be to limit input voltages to a range
>> between Vpos and Vneg that I would set. Using a series 
>> resistor, two diodes, and two voltage sources is a crude way 
>> to do it. I'm looking for something much more elegant.
>> 
>> Any takers ???
>> 
>> H^) harry
>> _______________________________________________
>> Synth-diy mailing list
>> Synth-diy at dropmix.xs4all.nl
>> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>> 
>> 
> 
> 
> 
> 
> 
> -- 
> Harry Bissell & Nora Abdullah 4eva
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy

-- 
Harry Bissell & Nora Abdullah 4eva



More information about the Synth-diy mailing list