Custom Search

Friday, October 24, 2008

Pulse response of an RLC Circuit

Using P Spice, for the following RLC circuit, calculate and plot the Transient Response from 0 to 400µs with a time increment of 1 µs .
Solution:-
[The capacitor voltage V (3) and the current R1, I(R1) are to be plotted]

Program

* PULSE (-VS +VS TD TR TF PW PER) ; Pulse input
VIN 1 0 PULSE(-220V 220V 0 1NS 1NS 100US 200US)
R1 1 2 2
L1 5 3 50UH
C1 3 0 10UF
*TRAN TSTEP TSTOP ; Command for Transient Analysis
.TRAN 1US 400US
*.PRINT TRAN V(R1) V(L1) V(C1) ; Prints to the output file
*.PLOT TRAN V(3) I(R1) ; Plots in the output file
.PROBE ; Graphical Wave form analyzer
.END ; End of circuit file

It should be noted that with the .PROBE command, there is no need for the .PLOT command; .PLOT generates the plot in the output file, while .PROBE sends graphical output to the monitor screen that can be dumped directly in to plotter or printer.
By putting asterisk (*) in front of .PLOT or .PRINT, there is no effect.

Friday, July 18, 2008

Polynomial source - pspice


The symbol for a polynomial or nonlinear source is POLY (n), where n is the number of dimensions of the polynomial .The default value of n is 1.The dimensions depend on the number of controlling sources. The general form is
POLY (n) {(controlling) nodes} {(coefficients) values}
The out put sources of the controlling sources can be voltage or currents.
For voltage controlled sources, the number of controlling nodes must be twice the number of dimensions.
For current controlled sources, the number of controlling sources must be equal to the number of dimensions.
The number of dimensions and the number of coefficients are arbitrary.


Let us call A,B, and C are the three controlling variables, and Y is the output source.
The following figure shows that is controlled by A,B, and C. The output source takes
The form of Y = f(A,B,C…..)
Where Y can be Voltage or Current
A,B,C can be Voltage or Current or any combination
For a Polynomial of n=1 with A as the only controlling variable, the source function takes
The form of Y=P0+P1A+P2A2+P3A3+P4A4+……………..PnAn
Where P0,P1,P2,P3,P4……………..Pn are the coefficient values. this is written in PSpice as
POLY NC1+ NC1- P0 P1 P2 P3 P4……………..Pn
Where NC1+ NC1- are the positive and negative nodes, respectively, of the controlling source A.
For a Polynomial of degree n=2 with A & B as the controlling sources, the source function takes the form of
Y=P0+P1A+P2B2+P3A2+P4AB+P5B2+ P6A3+ P7A2B+ P8AB2+ P9B3+……..
This is described in PSpice as
POLY (2)NC1+ NC1- NC2+ NC2- P0 P1 P2 P3 P4………….Pn
Where NC1+, NC2+,and NC1-, NC2- are the positive and negative nodes, respectively, of the controlling sources.

For a Polynomial of degree n=3 with A , B & C as the controlling sources, the source function takes the form of
Y=P0+P1A+P2B+P3C+P4A2+P5AB+ P6AC+ P7B2+ P8BC+ P9C2+P10A3+P11A2B+P12A2C+P13AB2+P14ABC+P15AC2+
P16B3+P17B2C+P18BC2+P19C3+P20A4+……………………
This is described in PSpice as
POLY (3)NC1+ NC1- NC2+ NC2-,NC3+ NC3- P0 P1 P2 P3 P4 P5……….Pn
Where NC1+, NC2+, NC3+ and NC1-,NC2-,NC3- are the positive and negative nodes, respectively, of the controlling sources.
Typical Model Statements, for Y=2V(10),The model is POLY 10 0 2.0
For Y=V(5)+2[V(5)]2+3[V(5)]3 +4[V(5)]4,
the model is POLY 5 0 0.0 1.0 2.0 3.0 4.0
For Y=0.5+V(3)+2V(5)+3[V(5)]3 +4[V(3) V(5),the model is
POLY(2) 3 0 5 0 0.5 1.0 2.0 3.0 4.0

Independent voltage and current sources - pspice

The symbol of an independent voltage source is V, and the general form for assigning dc and transient value is
V (Name) N+ N- [DC (value)]
+ [(transient value)]
+ [PULSE] [SIN] [EXP] [PWL] [SFFM] [source arguments]
[Note:-The first column with +(plus) signifies continuation of the P Spice statement .After the + sign, the statement can continue in any column.]
N+ is the positive node, and N- is the negative node as shown in the above fig(a),. Positive current flows from node N+ through the voltage source to the negative node N- .
The voltage source need not be grounded. For the dc and transient values, the default value is zero. None or all of the dc and transient values may be specified.
A source can be assigned either a dc value or a transient value. The source is set to the dc value in dc analysis. The time dependent source (e,g,.PULSE,EXP, or SIN) is specified for transient analysis. A voltage source may be used as an Ammeter in P Spice by inserting a zero-valued voltage source in to the circuit for the purpose of measuring current.
Typical Statements
V1 15 0 6V
V2 15 0 DC 6V
VPULSE 10 0 PULSE (0 1 2NS 2NS 2NS 50NS 100NS)
VIN 12 3 DC 15V SIN (0 2V 10KHZ)


INDEPENDENT CURRENT SOURCE
The symbol of an independent current source is I, and the general form for assigning dc and transient value is
I(Name) N+ N- [DC (value)]
+ [(transient value)]
+ [PULSE] [SIN] [EXP] [PWL] [SFFM] [source arguments]
N+ is the positive node, and N- is the negative node as shown in the above fig(b),. Positive current flows from node N+ through the current source to the negative node N- .
The current source need not be grounded. The source specifications are similar to those for independent voltage sources.
Typical Statements
I1 15 0 2MA
I2 15 0 DC 2MA
IPULSE 10 0 PULSE (0 1V 2NS 2NS 2NS 50NS 100NS)
IIN 22 22 DC 2 SIN(0 2V 10KHZ)

SINGLE- FREQUENCY FREQUENCY MODULATION - pspice

The symbol of a source with single –frequency frequency modulation is SFFM, and the general form is :

SFFM (V0 VA FC MOD FS)

The Model Parameters Of an Single- Frequency Frequency Modulation
Name Meaning Units Default
VO Offset Voltage Volts None
VA Amplitude of Voltage Volts None
FC Carrier Frequency Hertz 1/ TSTOP
MOD Modulation Index 0
FS Single Frequency Hertz 1/ TSTOP

VO and VA must be specified by the user and can be either voltage or currents.
TSTOP is the stop time during transient (.TRAN) analysis. The wave form is of the form by
V = VO + VA sin[(2πfct)+M sin(2πfSt)]

Typical statements.
VO =0,
VA=1V,
fc=30MHz,
MOD=5,
fS=5KHz,the model statement is,

SFFM ( 0 1V 30MHZ 5 5KHZ )

With VO =1Mv and VA=2V, the model becomes

SFFM ( 1MV 2V 30MHZ 5 5KHZ

PIECEWISE LINEAR SOURCE - pspice




The symbol of Piecewise linear source is PWL. And the general form is
PWL (T1 V1 T2 V2 T3 V3 …..TN VN)

A point in a wave form can be described by (Ti, Vi) or (Ti, Ii), and every pair of values (Ti, Vi) or (Ti, Ii), specifies the source value at Time Ti, The voltage at times between the intermediate points is determined by P Spice by using linear interpolation.

MODEL PARAMETERS OF PWL SOURCES
Name Meaning Units Default
Ti Time at a Point Seconds None
Vi Voltage at a Point Volts None
Typical Statements for the above wave form
T0 = 0
V0 = 0
T1 = 5
V1 = 3
T2 = 10us
V2 = 3V
T3 = 15us
V3 = 6V
T4 = 40us
V4 = 6V
T5 = 45us
V5 = 2V
T6 = 60us
V6 = 2V
T7 = 65us
V7 = 0
PWL (0 0 5 3 10US 3V 15US 6V 40US 6V 45US 2V 60US 2V 65US 0)

small signal Transfer Function - pspice


.TF (Small Signal Transfer Function)

the small signal Transfer function capability of P Spice can be used to compute the small signal DC gain , the input resistance and the output resistance of a circuit.
If V(1) and V(4) are the input and output variables respectively, P Spice calculate the small signal dc gain between nodes 1 and 4,defibned by
AV = ∆ V out / ∆ V in = V(4) / V(1)
Pspice calculates the small signal dc transfer function by linearizing the circuit around the OP. The statement for transfer function has one of the following forms

.TF VOUT VIN
.TF IOUT IIN
The .TF command calculates the parameters of an equivalent circuit for the circuit file, it automatically prints the out put and does not require .PRINT, .PLOT, .PROBE statements

.DC (DC Sweep)
The dc sweep is also known as the dc transfer characteristic. The input variable is varied over a range of values. For each value of the input variable, the dc operating point and the small signal dc gain are computed.
The simple statement for dc sweep
.DC LIN SWNAME SSTART SEND SINC
.DC OCT SWNAME SSTART SEND NP
.DC DEC SWNAME SSTART SEND NP
.DC SWNAME LIST (Value)
SWNAME is the sweep variable (voltage or current).
SSTART → sweep start value
SEND → sweep end value
SINC → sweep incremental value (it must be positive, not –ve or zero)
NP→ number of steps
LIN→ linear sweep
OCT→ sweep by octave
DEC→ sweep by decade
LIST→ list of values

simple dc circuit simulation using pspice

The following circuit is to be simulated on P Spice to calculate and print all node voltages and currents, and the power dissipation of all voltage sources (Vs, Vx, and Vy).
The circuit file stored as DC circuit.cir, and the Outputs stored in the file as DC circuit.out

The circuit file contains the following statements:
•VS 1 0 DC 20V : DC Voltage source of 20V
IS 0 4 DC 50MA : DC Current source of 50mA
••R1 1 2 500 : Resistance of 500Ohms
R2 2 5 800 : Resistance of 800Ohms
R3 2 3 1KOHM : Resistance of 1000Ohms
R4 4 0 200 : Resistance of 200Ohms
VX 3 0 DC 0V : Measures the current through R3
VY 5 4 DC 0V : Measures the current through R2
•••.OP : Directs the Bias Point to output file
.END : End of circuit file

The results that appear in the out put file are shown below
****SMALL SIGNAL BIAS SOLUTION TEMPERATURE=27.000 DEG C
NODE VOLTAGE
1 20.000
2 12.500
3 0.000
4 10.500
5 10.500
VOLTAGE SOURCE CURRENT
NAME CURRENT
VS -1.500E-02 IR1=15mA
VX 1.250E-02 IR3=12.5mA
VY 2.500E-02 IR2=2.5mA

TOTAL POWER DISSIPATION 3.00E-01 WATTS.