Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsElectronicsBasicsRepairDesignCADComponentsEquipmentElectrical Engineering
ElectronicsKB.com
Contact UsLink To UsSearch & Site Map

Electronics Forum / CAD / February 2005



Tip: Looking for answers? Try searching our database.

HSPICE to PSPICE Conversion

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gish - 19 Feb 2005 20:41 GMT
Hi Guys

I have some SPICE code that runs perfectly in HSPICE but will not run
in PSPICE due to issues with "subcircuit expansion."  If there's any
experts out there who could take a quick look at this and let me know
what the issue might be I'd appreciate it.

Thanks

******************************************************
**** circuit description
******************************************************
rs in inp 50
r1 inp vss 1K
x1 inp inm out vss my_opamp
rf out inm 100K
r2 inm vss 1K
******************************************************
**** parameters section
******************************************************
******************************************************
**** sources section
******************************************************
v1 in vss sin(0V 60mV 10x 100ps 0)
v2 vss 0 dc 0V
******************************************************
**** specify nominal temperature of circuit in degrees C
******************************************************
.TEMP= 60
******************************************************
**** analysis section
******************************************************
.tran 1ns 200ns
.END
Chaos Master - 19 Feb 2005 21:22 GMT
19 Feb 2005 12:41:24 -0800: Gish (----> andrewgish@comcast.net) ---->
sci.electronics.cad @
<1108845684.189581.57660@z14g2000cwz.googlegroups.com> :
> Hi Guys
>
[quoted text clipped - 13 lines]
> rf out inm 100K
> r2 inm vss 1K

What's the model for 'my_opamp' subcircuit (subckt)?

[]s
Signature

Chaos Master®, posting from Canoas, Rio Grande do Sul, Brazil - 29.55° S
/ 51.11° W / GMT-2h / 15m .

"People told me I can't dress like a fairy.
I say, I'm in a rock band and I can do what the hell I want!"
                                                  -- Amy Lee

(My e-mail address isn't read. Please reply to the group!)

Gish - 20 Feb 2005 04:25 GMT
Ok,

I actually figured everything out except for one line...

E1 out ref in+ in- MAX=5V MIN=-5V opamp_gain

I'm trying to code a VCVS with maximum and minimum output values, but
PSPICE rejects the MAX and MIN parts.  Any ideas?

Thanks

> Hi Guys
>
[quoted text clipped - 30 lines]
> .tran 1ns 200ns
> .END
Chaos Master - 20 Feb 2005 04:29 GMT
19 Feb 2005 20:25:20 -0800: Gish (----> andrewgish@comcast.net) ---->
sci.electronics.cad @
<1108873520.072521.37120@g14g2000cwa.googlegroups.com> :
> Ok,
>
[quoted text clipped - 4 lines]
> I'm trying to code a VCVS with maximum and minimum output values, but
> PSPICE rejects the MAX and MIN parts.  Any ideas?

I think that PSpice doesn't support MAX and MIN values.

[]s
Signature

Chaos Master®, posting from Canoas, Rio Grande do Sul, Brazil - 29.55° S
/ 51.11° W / GMT-2h / 15m .

"People told me I can't dress like a fairy.
I say, I'm in a rock band and I can do what the hell I want!"
                                                  -- Amy Lee

(My e-mail address isn't read. Please reply to the group!)

For spammers: renan.birck@ibestvip.com.br , or mips_r16000@hotmail.com .
             Those await for your spams!

Jim Thompson - 20 Feb 2005 16:57 GMT
>Ok,
>
[quoted text clipped - 15 lines]
>>
>> Thanks
[snip]

Here are a few of the operators in PSpice BEHAVIORAL elements:

LIMIT(x,min,max)  result is min if x < min, max if x > max, and x
                 otherwise

MAX(x,y)          maximum of x and y

MIN(x,y)          minimum of x and y

In addition you must use the BEHAVIORAL syntax of the E-source

So the correct expression for E1 is:

E1 out ref VALUE = {LIMIT((opamp_gain*V(in+,in-)),MIN,MAX)}

.PARAM MAX=5V MIN=-5V opamp_gain=100K

(Or put the numerics directly in the expression.)

This is convergence risk using mathematical limits, since they are
hard, and derivatives don't exist at the limit points.

I prefer using the TANH expression:

E1 1 0 VALUE {(tanh(A*V(INP,INN))+1)/2}
E2 OUT 0 VALUE {V(1,0)*(VP-VN)+VN}

.PARAM A=100K  ; OpAmp Gain
.PARAM VP=+5V  ; Positive Limit
.PARAM VN=-5V  ; Negative Limit

(Note that exact gain is an interaction between A, VP, and VN (E1
produces 0 ->1), but I'm still too sleepy this morning to make an
exact expression :)

                                       ...Jim Thompson
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
Jim Thompson - 20 Feb 2005 17:40 GMT
>Ok,
>
[quoted text clipped - 6 lines]
>
>Thanks

[snip]

Are you using PSpice "raw", i.e. without schematic capture?

Both PSpice Schematics and Capture (gag me with a spoon) have the
correct netlist TEMPLATE contained within the symbol.

(Not that I should be one to criticize.  I went for MANY years drawing
schematics with pencil and paper, numbering nodes, hand-typing
netlists, and batch-loading into Berkeley Spice 2G6 on an old VAX,
IIRC, 1170.  Then I discovered PC's and bought my first 386 for $6K...
cheap because it was a clone :-)

                                       ...Jim Thompson
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
           
I love to cook with wine.      Sometimes I even put it in the food.
Chaos Master - 20 Feb 2005 20:01 GMT
Sun, 20 Feb 2005 10:40:10 -0700: Jim Thompson (---->
thegreatone@example.com) ----> sci.electronics.cad @
<78ih11dl5n7vl7ipnvmfc19h6bm1i32d00@4ax.com> :

> (Not that I should be one to criticize.  I went for MANY years drawing
> schematics with pencil and paper, numbering nodes, hand-typing
> netlists, and batch-loading into Berkeley Spice 2G6 on an old VAX,
> IIRC, 1170.  Then I discovered PC's and bought my first 386 for $6K...
> cheap because it was a clone :-)

I sometimes end up doing this, even though I have 2 schematic editors
here (LTspice and SIMetrix Intro).

[]s
Signature

Chaos Master®, posting from Canoas, Rio Grande do Sul, Brazil - 29.55° S
/ 51.11° W / GMT-2h / 15m .

"People told me I can't dress like a fairy.
I say, I'm in a rock band and I can do what the hell I want!"
                                                  -- Amy Lee

(My e-mail address isn't read. Please reply to the group!)

For spammers: renan.birck@ibestvip.com.br , or mips_r16000@hotmail.com .
             Those await for your spams!

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.