Altium Designer PCB仿真教程.docx
《Altium Designer PCB仿真教程.docx》由会员分享,可在线阅读,更多相关《Altium Designer PCB仿真教程.docx(29页珍藏版)》请在冰豆网上搜索。
AltiumDesignerPCB仿真教程
SPICEModelCreationfromUserData
Summary
ThisapplicationnoteprovidesdetailedinformationoncreatingandautomaticallylinkingaSPICEsimulationmodeltoaschematiccomponent,basedondataenteredintoAltiumDesigner'sSPICEModelWizard.
InordertosimulateacircuitdesignusingAltiumDesigner'sMixed-SignalCircuitSimulator,allcomponentsinthecircuitneedtobesimulation-ready–thatis,theyeachneedtohavealinkedsimulationmodel.
Thetypeofmodelandhowitisobtainedwilllargelydependonthecomponentand,tosomeextent,onthepersonalpreferenceofthedesigner.Manydevicemanufacturer'ssupplysimulationmodelscorrespondingtothedevicestheymanufacture.Typically,it'sassimpleasdownloadingtherequiredmodelfile(SPICE,PSpice®)andhookingituptotheschematiccomponent.
SomeofthemorebasicanalogdevicemodelsinSPICErequirenodistinctmodelfile–onlyspecificationofsimpleparametervalueswhendefiningthemodellink(e.g.Resistor,Capacitor).Attachingthesetypesofmodelstoacomponentisstraigthforwardandsimplyaprocessofselect-and-enter(selectthemodeltypeandentertheparametervaluesdirectlyinanassociateddialog).
Somemodelsmayneedtobewrittenfromscratch–forexampleusingthehierarchicalsub-circuitsyntaxtocreatetherequiredsub-circuitmodelfile(*.ckt).Others–ifthedeviceisdigitalinnature–willrequirethedevicetobemodeledusingtheproprietaryDigitalSimCode™language,thedefinitionofwhichislinkedtothroughanintermediarymodelfile.
Certainanalogdevicemodelsbuilt-intoSPICEprovideforanassociatedmodelfile(*.mdl)inwhichtoparametericallydefineadvancedbehavioralcharacteristics(e.g.SemiconductorResistor,Diode,BJT).Creationofthismodelfilebyhandandthenlinkingitmanuallytotherequiredschematiccomponentcanbequitelaborious.Notanymore–enterAltiumDesigner'sSPICEModelWizard.UsingtheWizardthecharacetristicsofsuchadevicecanbedefinedbasedonuser-acquireddata.Theparameters–enteredeitherdirectlyorextractedfromsupplieddata–areautomaticallywrittentoamodelfileandthatfilelinkedtothenominatedschematiccomponent.
Formoreinformationonlinkingamodelfile,refertotheLinkingaSimulationModeltoaSchematicComponentapplicationnote.
Fordetailedinformationondefiningadigitalsimulationmodel,refertotheCreatingandLinkingaDigitalSimCodeModelapplicationnote.
TheSPICEModelWizard
TheSPICEModelWizardprovidesaconvenient,semi-automatedsolutiontocreatingandlinkingaSPICEsimulationmodelforarangeofanalogdevices–devicesthatarebuilt-intoSPICE,andthatrequirealinkedmodelfile(*.mdl).ThebehavioralcharacteristicsofthemodelaredefinedbasedoninformationyousupplytotheWizard.Theextentofthisinformationdependsonthedevicetypeyouwishtocreateamodelfor–rangingfromthesimpleentryofmodelparameters,totheentryofdevicedataobtainedfromamanufacturer'sdatasheetorbymeasurementsgainedfromthephysicaldeviceitself.
ThefollowingsectionsdiscusstheuseoftheWizard–fromaccesstoverification.
AccessingtheWizard
ThewayinwhichyouaccesstheWizarddependschieflyonhowyouwanttoaddtherequiredSPICEmodel.Amodelcanbeadded:
∙Toanewlycreatedcomponent(createdbytheWizard)inaschematiclibrarydocument
∙Toanexistingcomponentinaschematiclibrarydocument
∙Toaplacedcomponentonaschematicdocument.
AccessintheSchematicLibraryEditor
Ifyouareunsureofthedeviceyouwishtomodel,accesstheWizardbychoosingTools»XSpiceModelWizardfromthemainmenus.ByaccessingtheWizardinthisway,youwillbeabletochoose:
∙Whichparticulardeviceyouwishtomodel,fromthelistofsupporteddevicetypes(seeSupportedDeviceTypes).
∙Whethertoaddthesubsequently-generatedSPICEmodeltoanexistingcomponentinthelibrarydocumentortoanewcomponentthatiscreatedbytheWizardandaddedtothatdocument.
TheSPICEModelWizardisessentiallyacollectionofwizards-oneperdevicemodelsupported.ThisismadeespeciallyevidentwhenaccessingtheWizardfromtheSimModeldialog.
∙Ifyouwishtoaddthemodeltoanexistingcomponent,andhavelaunchedtheWizardusingthemainmenucommand,ensurethatthatcomponentistheactivecomponentinthelibrary.
YoucanalsoaccesstheWizardwhilesettingupasimulationmodellinkforanexistingcomponent.FromtheSimModeldialog,simplyensurethatthechosenentryintheModelSub-KindfieldisoneofthedevicetypessupportedbytheWizard(seeSupportedDeviceTypes),thenclickontheCreatebutton–totherightoftheModelNamefield(Figure2).
Figure2.AccesstheWizarddirectlyfromtheSimModeldialog.
TheSimModeldialogitselfcanbeaccessedfromaschematiclibrarydocumentinoneofthefollowingways:
∙FromtheLibraryComponentPropertiesdialog(Tools»ComponentProperties),byaddingasimulationmodelintheModelsregionofthedialog.(Appliestotheactivecomponentonly).
Ifyouareeditinganexistinglinkedsimulationmodel,usingtheWizardwillreplacetheexistingmodelwiththenewlycreatedone.
∙FromtheSCHLibrarypanel,byaddingasimulationmodelintheModelssectionofthepanel.(Appliestotheactivecomponentonly).
∙FromtheSchematicLibraryEditor'smaindesignwindow,byaddingasimulationmodelintheModelsregionofthewindow.(Appliestotheactivecomponentonly).
∙FromtheModelManagerdialog(Tools»ModelManager),byaddingasimulationmodelintheModelsregionofthedialog.(Appliestotheselectedcomponent(s)).
AccessintheSchematicEditor
UsingtheWizardwillreplaceanyexistingmodelwiththenewlycreatedone.
TheWizardcanalsobeaccessedwhendefiningthesimulationmodellinkforaplacedcomponentonaschematicsheet.Again,accessismadefromtheSimModeldialogbyclickingtheCreatebutton–providedofcoursethatthemodeltypeisoneofthoseforwhichadedicatedWizardisavailable.
Figure3.AccessingtheWizardforaplacedschematiccomponent.
SupportedDeviceTypes
TheWizardcanbeusedtocreateSPICEmodelsforthefollowinganalogdevicetypes:
∙Diode
∙SemiconductorCapacitor
∙SemiconductorResistor
∙Current-ControlledSwitch
∙Voltage-ControlledSwitch
∙BipolarJunctionTransistor(BJT)
∙LossyTransmissionLine
∙UniformDistributedRCTransmissionLine
NamingtheModel
WhenusingtheWizardtoaddamodeltoanewlibrarycomponent,thenamespecifiedforthemodelwillbeusedtonamethecomponentalso.
OneofthemostimportantstepsasyoufollowthepagesoftheWizard,istoprovideanameforthemodelyouarecreating.Infact,youwillnotbeabletoproceedtotheparameterdefinitionstageoftheWizarduntilyouhaveenteredaname.
Aftercreation,thisnamewillappearintheModelNamefieldoftheSimModeldialog.Themodelfileitselfisalsocreatedusingthisname(ModelName.mdl).
Figure4.Defineameaningfulnameforthemodel.
Whennamingthemodel,youalsohavetheoptiontoenterashortdescriptionforit.Thiscouldbethefunctionofthemodel(e.g.SemiconductorResistor),oramorespecificreferencetoavalueorconfiguration(e.g.NPNBJT).
CharacteristicstobeModeled
Aftergivingthemodelaname,youwillproceedtooneormorepagesdealingwiththecharacteristicstobemodeled.ThemodeltypessupportedbytheWizardcanbecategorizedintothefollowingtwogroups:
∙Thosemodelsrequiringdirectentryofvaluesforvariousmodelparameters.Forfurtherinformation,seethesectionDeviceModelsCreatedbyDirectParameterEntry.
Aparameterspecifiedinthemodelfileforadevicewilloverrideitsdefaultvalue(inherenttotheSPICEengine).
∙Thosemodelsrequiringtheentryofdatafromwhichtoextracttheparametersthatdefinethechosendevicecharacteristics.Thedataenteredisobtainedeitherbydirectmeasurementresultsfromthephysicaldevice,orfromamanufacturer'sdatasheet.Forfurtherinformation,seethesectionDeviceModelsCreatedbyParameterExtractionfromData.
OnlyparametersdefinablewithinamodelfileareconsideredbytheWizard.AnyparametersthataredefinableatthecomponentlevelforadeviceshouldbeaddressedusingtheParameterstaboftheSimModeldialog,oncetheWizardhasfinishedcreatingthemodelfile.
GeneratingtheModel
Afterentryoftherequireddata/parameters,theWizardwilldisplaythegeneratedmodel(Figure5).ThisisthecontentthatwillbesavedtotheMDLfile.
Figure5.Previewingthegeneratedmodelfilecontent.
Editingofthemodelcanbecarriedoutdirectlyonthispage,givingyoutheutmostcontrolovermodelspecification.
Onceyouaresatisfiedwiththemodeldefinition,simplyclickNexttopasstotheendoftheWizard.ClickingFinishwillallowyoutosavethemodel.UsetheSaveSPICEModelFiledialogtodeterminewheretheresultingMDLfileshouldbesaved.Bydefault,thefilewillbesavedtothesamedirectoryastheschematiclibrarydocument.Youcanalsochangethenameofthefileatthisstage,shouldyouwish.
Ifyouhaverequestedthemodelbeattachedtoanewcomponent,thatcomponentwillbecreatedandaddedtothelibrarydocument.
Althoughthemodelislinkedautomaticallytothecomponent–neworexisting–youshouldmakeahabitofverifyingthemappingofschematiccomponentpinstopinsofthemodel.SimplyaccesstheSimModeldialogfortheattachedmodel,clickonthePortMaptab,andcheckthepinmapping–makinganychangesifrequired.
Figure6.Verifythecomponent-to-modelmapping.
Defineanyadditionalparametersavailableforthemodel–ontheParameterstaboftheSimModel