converting LTSPICE Bxxx sources to PSPICE code

Thread Starter

ron111

Joined Feb 24, 2018
1
I need to port a model to PSPICE, specifically these three commands for B sources

* if/then/else voltage source
B1 pwm 0 V=if((V(VIN,CMN_IN)+1-V(carrier_ramp))>0 , 1, 0)

*voltage source: multiply a node voltage by a parameter
B2 VOUT_P CMN_POUT V={V_OUT*V(pwm_p3)}

*voltage source: delay node voltage by a specified amount of time
B1 N002 0 V=delay(V(out),TPULSE)
 

eetech00

Joined Jun 8, 2013
3,959
I need to port a model to PSPICE, specifically these three commands for B sources

* if/then/else voltage source
B1 pwm 0 V=if((V(VIN,CMN_IN)+1-V(carrier_ramp))>0 , 1, 0)

*voltage source: multiply a node voltage by a parameter
B2 VOUT_P CMN_POUT V={V_OUT*V(pwm_p3)}

*voltage source: delay node voltage by a specified amount of time
B1 N002 0 V=delay(V(out),TPULSE)
Hi

I've successfully converted a few from Pspice to LTspice, but not the other way.
I believe the first one would be converted to this:

E1 pwm 0 VALUE={ if((V(VIN,CMN_IN)+1-V(carrier_ramp))>0 , 1, 0) }

The "IF" conditional expression syntax is the same for both simulators.

The other two statements would be converted the same way.

E2 VOUT_P CMN_POUT VALUE={ {V_OUT*V(pwm_p3)} }

E3 N002 0 VALUE={ delay(V(out),TPULSE) }

Pay close attention to whether the B source is for current or for voltage. For current, use a Pspice G source.

eT
 
Last edited:
Top