Simulation Manager for OrCAD PSpice Dalibor Biolek 1,2, Jaroslav Kadlec 1 1,2 Faculty of EE and...
-
Upload
helen-dudney -
Category
Documents
-
view
222 -
download
1
Transcript of Simulation Manager for OrCAD PSpice Dalibor Biolek 1,2, Jaroslav Kadlec 1 1,2 Faculty of EE and...
Simulation Manager for OrCAD PSpice
Dalibor Biolek1,2, Jaroslav Kadlec1
1,2 Faculty of EE and Communications, Dept. of MicroelectronicsBrno University of Technology, Czech Republic
1 Faculty of Military Technologies, Dept. of EEUniversity of Defence, Brno, Czech Republic
Outline
•Why PSiM (PSpice Simulation Manager)
•PSiM Conception
•PSiM Features
•Demonstrations
•Conclusions
Why PSiM
OrCAD PSpice limitations:
•ICL (Interactive Command Language) is not implemented
•No possibility to work in so-called sequential mode
•Results of the analysis cannot be input data of the following analysis
circuit file PSpice analysis results
headernetlistcommands.end
output fileProbe files...
pspice.exe
psp_cmd.exe
user
PSiM Conceptioncircuit file PSpice analysis results
headernetlistcommands.end
output fileProbe files...
psp_cmd.exe
SIM
user
Manager Control File
header
commands
PSiM Conception
assemblycir x.cir
endassembly
...Rx 1 2...
...set variable=1...
.
...
...
Extended Circuit File
x.cir
data from .TRAN, .AC, .DC
data from bias points
run
Manager Control File (MCF)
(ECIR)
PSpice Circuit File(PCIR)
variable
re-defining the variables
x.dat
x.out
x.csd
x.bias
psp_cmd.exe
PSiM Features
•The PSiM reads the MCF step-by-step, starting from the first line.
•The programming language of the PSiM should support mathematical computations.
•The ECIRs of the circuits being analyzed can appear in the MCF.
•The PCIR can be modified prior to its generation by the PSiM.
•The PSiM is able to process the results of executed simulations.
•All the files generated from all executed simulation runs should be available.
•The PSiM manages commands for program loops and chaining.
PSiM Demonstrations
Optimization of transistor amplifier
Rc design in order to set voltage gain to 10 on a frequency of 1kHz
Vin
1Vac
Cv
10u
Rb1180k
Rb233k
Q1
Re200
Rc1.9k
Vbat12V
0
0
00
in bc
e
bat
2N2222
Preliminary PSpice analysis: The gain is approximately 9.
PSiM Demonstrations
Optimization of transistor amplifier
1: *transistor amplifier2: set Rc 1.9k gain 13: while (gain)<=104: assemblycir run.cir5: *beginspice6: Vbat bat 0 12V7: Q c b e Q2N22228: Rc bat c #$Rc$9: Re e 0 20010: Rb1 bat b 180k11: Rb2 b 0 33k12: Cv in b 10u13: Vin in 0 AC 114: .lib15: *endspice16: genFpoint AMPLI 1k {v([c])}17: endassembly18: getFpoint AMPLI gain 119: set Rc Rc+2020: endwhile
Vin
1Vac
Cv
10u
Rb1180k
Rb233k
Q1
Re200
Rc1.9k
Vbat12V
0
0
00
in bc
e
bat
2N2222
The analysis runs 11 times. Two last results (Rc, gain):
2100 Ohms, 9.997
2120 Ohms, 10.09
PSiM Demonstrations
AC analysis of SH circuit
v(t)
RC
v (t) v(t)
t
t
kT+T
kT+TkT
tv e1
tv e2
1 2 1 2 1 2 1 21 2 1 2
1
in
v (t) in
)()()( 1111 TkTvbkTvaTkTv in
)()()( 212 TkTvbTkTvaTkTv in
1,1/
2111
inTT VbzVaV
2,2/
1222
inTT VbzVaV
=0
PSiM Demonstrations
AC analysis of SH circuit
)()()( 1111 TkTvbkTvaTkTv in
)()()( 212 TkTvbTkTvaTkTv in
1,1/
2111
inTT VbzVaV
2,2/
1222
inTT VbzVaV
=0
For k=1..2 *computing coefficients bk circuit model in phase k, vin=1V, zero initial conditions TRANSIENT analysis, Tmax =Tk reading the state variable and saving it to the variable bk *computing coefficients ak circuit model in phase k, vin=0V, zero initial conditions the state variable v = 1 TRANSIENT analysis, Tmax=Tk reading the state variable and saving it to the variable akend
Algorithm of the MCF:
PSiM Demonstrations
AC analysis of SH circuit
)()()( 1111 TkTvbkTvaTkTv in
)()()( 212 TkTvbTkTvaTkTv in
1,1/
2111
inTT VbzVaV
2,2/
1222
inTT VbzVaV
=0
Compiling the z-domain equations via behavioral modeling (E-sources)
Solving equations via .AC analysis
PROBE demonstration of frequency responses
Algorithm of the MCF:
PSiM Demonstrations
AC analysis of SH circuit
1: *AC analysis of Sample-Hold circuit2: set Ron 5k fs 100k T1 0.1/fs T2 1/fs-T13: beginnet SH14: Ron 1 2 #$Ron$5: Rs 2 3 10m6: C 3 0 1n7: Rz 2 0 100k8: endnet9: beginnet SH210: Rs 2 3 10m11: C 3 0 1n12: Rz 2 0 100k13: endnet14: defsim tran1 .TRAN 0 #$T1$ 0 #$T1/100$ skipbp15: defsim tran2 .TRAN 0 #$T2$ 0 #$T2/100$ skipbp16: defsim AC .AC dec 100 10 #$fs*2$17: assemblycir run1.cir18: Vin 1 0 1V19: use SH120: runsim tran121: endassembly
PSiM Demonstrations
AC analysis of SH circuit
22: getprobe b tran1 V(3) #$T1$23: assemblycir run2.cir24: Vin 1 0 0V25: use SH126: .IC V(3) 1V27: runsim tran128: endassembly29: getprobe a1 tran1 V(3) #$T1$30: assemblycir run3.cir31: use SH232: .IC V(3) 1V33: runsim tran234: endassembly35: getprobe a2 tran2 V(3) #$T2$36: assemblycir run4.cir37: Vin 1 0 AC 138: Ec1 c1 x LAPLACE {V(c2)} {#$a1$*exp(-s*#$T1$)}39: Ex x 0 value={V(1)*#$b$}40: Ec2 c2 0 LAPLACE {V(c1)} {#$a2$*exp(-s*#$T2$)}41: runsim AC/nocsdf42: endassembly
PSiM Demonstrations
AC analysis of SH circuit
Frequency responses
Frequency
100Hz 10KHz10Hz 200KHz
DB(V(c1)) DB(V(c2))
-20
-10
0
Conclusions
•PSiM is an independent executable program which controls the OrCAD PSpice.
•It extends significantly the OrCAD PSpice features: Special simulation tasks can be performed which cannot be done by PSpice alone.
•Currently the PSiM working on the text file level is available.
•The graphical User's Interface (GUI) is developed.