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.

Modeling of Transient sources in pspice

MODELING OF TRANSIENT SOURCES
P Spice allows the generation of dependent (or independent) voltage and current sources. Independent sources can be time variant .A nonlinear source can also be simulated by a polynomial.
The independent voltage and current sources that can be modeled by P Spice as follows:
1. Exponential
2. Pulse
3. Piecewise linear
4. Sinusoidal
5. Single- frequency frequency modulation

1. EXPONENTIAL SOURCE:
The symbol of exponential source is EXP. and the general form is
EXP (V1 V2 TRD TRC TFD TFC)
The waveform of an exponential waveform:










V1 and V2 must be specified by the user and can be either voltage or currents (TSTEP is the incrementing time during transient [.TRAN] analysis. In an exponential wave form, the voltage remains V1 for the first TRD seconds .Then the voltage raises exponentially from V1 to V2 with a fall time constant of TFC.
MODEL PARAMETERS OF EXPONENTIAL SOURCES
Name Meaning Units Default
V1 Initial Voltage Volts None
V2 Pulsed Voltage Volts None
TRD Rise Delay Time Seconds 0
TRC Rise Time Constant Seconds TSTEP
TFD Fall Delay Time Seconds TRD+TSTEP
TFC Fall Time Constant Seconds TSTEP
Typical Model Statements
V1=0,V2=1V
TRD=2ns , TRC=20ns
TFD=60ns , TFC=30ns
EXP ( 0 1 2NS 20NS 60NS 30NS)

The other sources will be discussed in future posts

Inductor parameters - PSPICE

INDUCTOR
The symbol for a Inductor is L .The name of a Inductor must start with L, and it takes the following general form
L(name)N+ N- LNAME LVALUE IC=Vo
N+ is the positive node and N- is the negative node. The voltage of node N+ is assumed positive with respect to node N-, and the current flows from node N+ through the Inductor to node N-. LNAME is the model name, and LVALUE is the nominal value of the Inductor, IC defines the initial (time zero) current of the Inductor, Io.
If LNAME is omitted, LVALUE is the Inductance in Henrys, and the LVALUE can be positive or negative but must not be zero.

MODEL PARAMETERS FOR INDUCTORS
Name Meaning Units Default
L Inductance multiplier 1
IL1 Linear Current Co efficient Amps -1 0
IL2 Quadratic Current Co efficient Amps -2 0
TC1 Linear Temperature Co efficient °C -1 0
TC2 Quadratic Temperature Co efficient °C -2 0

IND=LVALUE * L * (1+IL1*I+IL2*I2
* [1+TC1 * (T – To) + TC2 * (T – To) 2 ]
where T is the operating temperature in degrees Celsius ,and To is the room temperature in
degrees Celsius.
Note:- L is an inductance multiplier, rather than the value of the inductance .It scales the actual inductance value .LVALUE ,thus ,L=1.1 means that LVALUE is multiplied by 1.1,not that LVALUE is 1.1H
Some Inductor statements

L1 6 5 10MH
LLOAD 12 11 5UH IC=0.2MA
LLINE 15 14 ACAP 5MH
LCHOKE 20 19 ACAP 20NF IC=0.5MA
.MODEL LMOD IND (L=1 IL1=0.1 IL2=0.002 TC1=0.02 TC2=0.005)

CAPACITOR parameters - pspice

CAPACITOR

The symbol for a capacitor is C .The name of a capacitor must start with C, and it takes the following general form
C(name)N+ N- CNAME CVALUE IC=Vo
N+ is the positive node and N- is the negative node. The voltage of node N+ is assumed positive with respect to node N-, and the current flows from node N+ through the capacitor to node N-. CNAME is the model name, and CVALUE is the nominal value of the capacitor, IC defines the initial (time zero) voltage of the capacitor, Vo.
If CNAME is omitted ,CVALUE is the capacitance in farads ,and the CVALUE can be positive or negative but must not be zero .

MODEL PARAMETERS FOR CAPACITORS
Name Meaning Units Default
C Capacitance multiplier 1
VC1 Linear Voltage Co efficient Volt -1 0
VC2 Quadratic Voltage Co efficient Volt -2 0
TC1 Linear Temperature Co efficient °C -1 0
TC2 Quadratic Temperature Co efficient °C -2 0


C is a capacitance multiplier, rather than the value of the capacitance .It scales the actual capacitance value .CVALUE ,thus ,C=1.1 means that CVALUE is multiplied by 1.1,not that CVALUE is 1.1F
Some Capacitance statements
C1 6 5 10UF
CLOAD 12 11 5PF IC=2.5V
CINPUT 15 14 ACAP 10PF
C2 20 19 ACAP 20NF IC=1.5V
.MODEL ACAP CAP (C=1 VC1=0.01 VC2=0.002 TC1=0.02 TC2=0.005)

variables and their meanings in PSPICE

Voltage Output
For DC Sweep and Transient Analysis, the output voltages can be obtained by the following statements:

VARIABLES MEANING
V(5) Voltage at Node 5 with respect to Ground
V(4,2) Voltage of Node 4 with respect to Node2
V(R1) Voltage of Resistor R1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(L1) Voltage of Inductor L1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(C1) Voltage of Capacitor C1,where the first Node(as defined in the circuit file) is positive with respect to the second Node.
V(D1) Voltage across Diode D1,where the first Node is positive with respect to the cathode.

Current Output
For DC Sweep and Transient Analysis, the output currents can be obtained by the following statements:

VARIABLES MEANING
I(VS) Current Flowing into DC Source Vs.
I(R5) Current Flowing into Resistor R5,where the Current is assumed to flow from the first Node(as defined in the Circuit file )through R5 to the second Node.
I(D1) Current into diode D1.
IA(T1) Current at Port A of Flowing in to DC Source Vs.

symbols for two terminal elements - pspice

SYMBOLS FOR TWO TERMINAL ELEMENTS
C Capacitor
D Diode
E Voltage Controlled Voltage Source
F Current Controlled Current Source
G Voltage Controlled Current Source
H Current Controlled Voltage Source
I Independent Current Source
L Inductor
R Resistor
V Independent Voltage Source

Thursday, July 17, 2008

Operating Temperature - PSPICE

OPERATING TEMPERATURE

(Command: .TEMP) in degrees Celsius °C.
The operating temperature of an analysis can be set to any desired value by the .TEMP command .The general form is,
.TEMP { (one or more temperature) values } [default 27 °C]
Some temperature statements
.TEMP 50
.TEMP 25 50
.TEMP 0 25 50 100

Wednesday, July 16, 2008

Program for analysis of three phase circuit representing generator transmission line and load - PSPICE

The aim of the program is to analyze the three phase circuit representing generator transmission line and load and to plot 3 phase current and neutral current.

Problem:
220v,
50hz supply is applied to
a) balanced 3-phase star connected load contains 25 ohms of resistance and 6mH of inductance in each phase
b)
Un-balanced 3-phase star connected load of 10 ohms, 3mH inductance, 20ohms, 4mh & 30 ohms , 5mh inductance for 3-phase respectively. Plot 3 phase currents and neutral laod. If source L is 6mH and value of neutral inductance is 7mH


PROGRAM CODE ( for balanced 3-phase analysis )

*balanced 3-phase analysis
*source description
VS1 1 2 SIN(0 220 50HZ 0 0 0DEG)
VS2 1 4 SIN(0 220 50HZ 0 0 120DEG)
VS3 1 6 SIN(0 220 50HZ 0 0 240DEG)
VS4 10 9 DC 0V
VS5 10 11 DC 0V
VS6 10 13 DC 0V
VS7 0 10 DC 0V
*COMPONENT DESCRIPTION
L1 2 3 6M
L2 4 5 6M
L3 6 7 6M
L4 1 0 6M
L5 8 3 6M
L6 14 5 6M
L7 12 7 6M
R1 8 9 25
R2 12 11 25
R3 14 13 25
* ANALYSIS DESCRIPTION
.TRAN 20ms 160ms
*OUTPUT DESCRIPTION
.PROBE
.END
OUTPUT

Program for analysis of three phase circuit representing generator transmission line and balanced load

PROGRAM CODE ( for Un-balanced 3-phase analysis )

*unbalanced 3-phase analysis
*source description
VS1 1 2 SIN(0 220 50HZ 0 0 0DEG)
VS2 1 4 SIN(0 220 50HZ 0 0 120DEG)
VS3 1 6 SIN(0 220 50HZ 0 0 240DEG)
VS4 10 9 DC 0V
VS5 10 11 DC 0V
VS6 10 13 DC 0V
VS7 0 10 DC 0V
*COMPONENT DESCRIPTION
L1 2 3 6M
L2 4 5 6M
L3 6 7 6M
L4 1 0 6M
L5 8 3 3M
L6 14 5 4M
L7 12 7 5M
R1 8 9 10
R2 12 11 30
R3 14 13 20
* ANALYSIS DESCRIPTION
.TRAN 20ms 160ms
*OUTPUT DESCRIPTION
.PROBE
.END

OUTPUT Program for analysis of three phase circuit representing generator transmission line and unbalanced load

The format for a circuit file in PSPICE

The Format for a Circuit File is as follows:
Title
Circuit description
Analysis description
Output description
.End
Note:
1. First line is the title line, always in the first line only& it may be contain any type of text
2. Last line must be the .End command and it always in the last line only.
3. The order of remaining three lines is not important in sequence &does not affect the O/P results of Simulation.
4. In a statement if more than one line, the statement can be continue on the next line,
a continuation line is identified by a(+)sign in the first column of the next line.
The continuation line must follow one another in the proper order.
5. P Spice comments or statements can be in either upper case or lower case.
6. In P Spice the symbols are represented with out subscripts Ex:-Vs =VS , Is =IS , R1 =R1 ,

Tuesday, July 15, 2008

Unit suffixes in PSPICE

The Unit suffixes in P Spice are as follows.
V = Volts
A = Amps
HZ = Hertz
OHM = Ohm(O)
H = Henry
F = Farad
DEG = Degree.

In the absence of scale and unit suffixes, the unit of voltage, current, frequency, inductance, capacitance and angle are, by default, volt, amps, hertz, henrys, farads, and degrees, respectively. P Spice ignores any unit suffix.

25E-3 25.0E-3 25M 25MA 25MOHM 25MH

NOTE:-The scale suffixes are all upper case, but PSpice allows lower case.
M Means “milli,” not “mega” 2MO is written as 2MEG or 2MEGOHM

Monday, July 14, 2008

Options in PSPICE

.OPTIONS (Options)
P Spice allows various options to control and to limit parameters for the various analysis. The general form is
.OPTIONS [ <(options)name>] [ <(options)name>=]
the options can be listed in any order. There are two types of options
1. With out values (used as flags of various kinds, and only option name is mentioned
2. With values (used to specify certain optional parameters, name and their values) as given below.

Option(with out values) Effects
LIST Causes summary of all circuit elements (or devices) tobe output
NOPAGE Suppresses paging and printing of a banner for each major section
NODE Causes out put of net list
Option (with values) Effects Unit Default

TNOM Default Temperature Degrees°C 27
ITL1 DC and Bias Point “blind” Iteration limit 40
ITL2 DC and Bias Point “educated guess” Iteration limit 20
ITL4 Iteration limit at any point in Transient analysis 10
ITL5 Total Iteration limit for all points in Transient analysis 5000
(ITL5=0 means ITL5=infinite)
RELTOL Relative Accuracy of voltages and currents 0.001
TRTOL Transient Analysis accuracy adjustment 7.0
ABSTOL Best Accuracy of currents Amps 1pA
CHGTOL Best Accuracy of charges coulomb 0.01Pc
VNTOL Best Accuracy of voltages volt 1uV
GMIN Minimum conductance used for any branch Ohm-1 1E-12

Sunday, July 13, 2008

Circuit elements and their symbols - PSPICE

Circuit elements and their Symbols
First Letter Circuit elements and sources
B Ga As MES Field effect transistor
C Capacitor
D Diode
E Voltage Controlled Voltage Source
F Current Controlled Current Source
G Voltage Controlled Current Source
H Current Controlled Voltage Source
I Independent Current Source
J Junction Field effect transistor
K Mutual Inductors (Transformer)
L Inductor
M MOS Field effect transistor
Q Bipolar Junction transistor
R Resistor
S Voltage Controlled Switch
T Transmission Line
V Independent Voltage Source
W Current Controlled Switch.

Saturday, July 12, 2008

Types of analysis in PSPICE

Types of Analysis
PSpice allows various types of analysis. Each analysis is invoked by including its command statements.
Ex:-.DC command invoked the DC Sweep.
DC Analysis is used for circuits with time variant sources(ex:-steady state dc source ).
It calculates all node voltages and branch currents over a range of values ,and their quiescent(dc)values are the outputs.
Command Meaning
1..DC DC Sweep of an input voltage or current source ,a model parameter ,or temperature over a range of values
2..OP Determination of the linearized model parameters of non linearized devices.
or DC Operating Point or Quiescent Point or Bias Point.
3..TF Small Signal Transfer Function with small signal Gain, input resistance, and output resistance.
4..SENS DC Small signal sensitivities.
5..TRAN Transient analysis with time variant sources It calculates all node voltages and branch currents over a time interval ,and their instantaneous values are the out puts
6.(.) dot an integral part of the command.

It can perform various analyses which invoked by including its command statements .It always calculates the bias point, which consists of all node voltages as well as currents and power dissipation of all voltage sources can be sent tot the output file by the .OP Command

Thursday, July 10, 2008

Limitations in PSPICE

Limitations of P Spice .
1. It is restricted to circuit with 10 Transistors only.
2. With out editing the program, the circuit cannot be analyzed for various component values; means the program is not interactive.
3. P Spice does not support an iterative method of solution.
4. It cannot be used to synthesize the circuit elements
5. The input impedance cannot be determined directly with out running the. PROBE.
6. Distortion analysis is not available in P Spice.
7. The out put impedance of a circuit cannot be printed or plotted directly.