summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFahim2016-03-02 13:42:25 +0530
committerFahim2016-03-02 13:42:25 +0530
commit0b0949cb657b07341c9cb17a9bce5c7e1aee09f4 (patch)
tree85f0adde2d87490f8cda367a9c80957215d83b61 /src
parent9347ac2e7c7d7c0693cd85327297b519196dbb90 (diff)
downloadeSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.tar.gz
eSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.tar.bz2
eSim-0b0949cb657b07341c9cb17a9bce5c7e1aee09f4.zip
Bug fixing for transformer model
Diffstat (limited to 'src')
-rw-r--r--src/kicadtoNgspice/Convert.py6
-rw-r--r--src/kicadtoNgspice/Processing.py20
2 files changed, 22 insertions, 4 deletions
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
index c7e03210..0a38b28e 100644
--- a/src/kicadtoNgspice/Convert.py
+++ b/src/kicadtoNgspice/Convert.py
@@ -225,11 +225,11 @@ class Convert:
num_turns2=str(self.obj_track.model_entry_var[start+5].text())
if num_turns2=="": num_turns2="620"
addmodelLine=".model "+line[3]+"_primary lcouple (num_turns= "+num_turns+")"
- modelParamValue.append([line[0],addmodelLine,line[4]])
+ modelParamValue.append([line[0],addmodelLine,"*primary lcouple"])
addmodelLine=".model "+line[3]+"_iron_core core ("+bh_array+" area = "+area+" length ="+length +")"
- modelParamValue.append([line[0],addmodelLine,line[4]])
+ modelParamValue.append([line[0],addmodelLine,"*iron core"])
addmodelLine=".model "+line[3]+"_secondary lcouple (num_turns ="+num_turns2+ ")"
- modelParamValue.append([line[0],addmodelLine,line[4]])
+ modelParamValue.append([line[0],addmodelLine,"*secondary lcouple"])
except Exception as e:
print "Caught an exception in transfo model ",line[1]
print "Exception Message : ",str(e)
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index fd9795e6..a80084ce 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -160,7 +160,7 @@ class PrcocessNetlist:
unknownModelList = []
multipleModelList = []
plotList = ['plot_v1','plot_v2','plot_i2','plot_log','plot_db','plot_phase']
-
+ interMediateNodeCount=1
k = 1
for compline in schematicInfo:
words = compline.split()
@@ -336,6 +336,24 @@ class PrcocessNetlist:
elif compType == 'transfo':
schematicInfo.insert(index,"* "+compline)
+
+ #For Primary Couple
+ modelLine = "a"+str(k)+" ("+words[1]+" "+words[2]+") (interNode_"+str(interMediateNodeCount)+" "+words[3]+") "
+ modelLine += compName+"_primary"
+ schematicInfo.append(modelLine)
+ k=k+1
+ #For iron core
+ modelLine = "a"+str(k)+" ("+words[4]+" "+words[2]+") (interNode_"+str(interMediateNodeCount+1)+" "+words[3]+") "
+ modelLine += compName+"_secondary"
+ schematicInfo.append(modelLine)
+ k=k+1
+ #For Secondary Couple
+ modelLine = "a"+str(k)+" (interNode_"+str(interMediateNodeCount)+" interNode_"+str(interMediateNodeCount+1)+") "
+ modelLine += compName+"_iron_core"
+ schematicInfo.append(modelLine)
+ k=k+1
+ interMediateNodeCount += 2
+
modelname = "transfo"
comment = "* "+compline
title = "Transformer details for model "+compName