You need to use EasyEDA editor to create some projects before publishing
Trying to Edit/Add Spice Model
7728 5
BRUNEL 9 years ago
How do I edit the SPICE model? THe instructions say I can edit this using the menu on the right using Properties>Text Attributes>Text Type>= SPICE. I don't see this option. I have Properties>Part Attributes - which gives the part name and not much else. Am I missing something here?
Comments
andyfierman 9 years ago
`This reply is is more than one section.` You see >**Properties>Part Attributes** in the right hand properties panel because you have selected the schematic ** *symbol* **. If you want to attach or change the spice model associated with a schematic symbol then you can paste a model into the schematic as a block of ** *text* **, select it and then do: **Properties > Text Attributes > Text Type > spice** to change this text in the schematic to be recognised as an active spice directive (i.e. as an active spice model) and not just as passive text. This is illustrated in a number of examples: **For .MODEL defined models** Find a spice .model for your target device; Copy and paste it into a text placeholder (the T hotkey) in your schematic (but please respect the EULA and copyright of commercial files); In the right hand properties panel, change the text type from comment to spice; >**Properties > Text type > spice** Place a symbol for the device from the EasyEDA Libs palette onto the schematic; Edit the model name to the exact name of the model in the pasted file. Done! There's an example of this here: [Playing with model parameters] [Playing with model parameters]:https://easyeda.com/editor#id=Ev5rpnJG2 This is another example showing using a generic depletion mode MOSFET. It also shows a way to hack a MOSFET defined by a LEVEL 3 .model statement but which has a problem with some of the parameters not being recognised as being part of the model by ngspice, so that it can still be used directly with the MOSFET symbol. In this example the L and W parameters of the original model are recognised as part of the .model statement. Note also that some of the other parameters are also simply not recognised by ngspice. Here's how: Find a spice .model for your target device; Copy and paste the .model statement into the schematic canvas; Turn it into a spice directive: >**Properties > Text Attributes > Text type > spice** Place an N channel depletion mode MOSFET symbol onto the schematic; Edit the 'model' attribute for M1 to include the unrecognised or modified L and W parameters so they look like this: `IXTT20N50D L=2E-6 W=5.5` This can be done either in place or via: >**Part Attributes > Model > IXTT20N50D L=2E-6 W=5.5** Note that adding an asterisk at the start of the two lines in the .model statement that define the L and W (and any other unrecognised parameters as deemed necessary) parameters will comment them out. This stops these parameters being reported as model issues in the simulation report but it is not required to do so. This process is illustrated in the following example: [N channel depletion mode MOSFET using a .model statement] [N channel depletion mode MOSFET using a .model statement]:https://easyeda.com/editor#id=NnhztL2kC `Continued ....`
Reply
andyfierman 9 years ago
`Second part of reply...` **For .SUBCKT defined models** The process described above works fine for simple .model defined models but for .subckt defined models it is a little more complicated because you need to tell EasyEDA that the model is a .subckt and not a simple .model. Note that even some humble diode models are in fact .subckt defined to include things like package parasitics. For example, compare the 1N4148 and the 1N4148W-V models in the netlist. There are three stages in attaching a .subckt to a symbol that already has a spice prefix of 'X' and so is expecting to call a .subckt statement. Place the .subckt text into the schematic and activate it; Place the symbol in the schematic; Change the name of the symbol to exactly the same as the name of the .subckt; The detailed steps to associate a new .subckt model to the symbol are: Find a spice .SUBCKT for your target device; Copy and paste it into a text box (the T hotkey) in your schematic (but please respect the EULA and copyright of commercial files); In the right hand properties panel, change the text type from comment to spice; >**Properties > Text type > spice** Place a symbol for the device from the EasyEDA Libs palette onto the schematic; Edit the model name to the exact name of the model in the pasted file; Press the 'I' Hotkey or: Click the blue 'Edit Symbol...' button in the Properties panel: >**Properties > Edit Symbol...** or do: >**Super Menu > Miscellaneous > Edit Symbol** In the 'Modify your symbol information' dialogue box, check that the 'Spice Prefix' is 'X'; Check that the NUMBER of pins in 'Edit Pin Map information' is exactly the same as in the .SUBCKT pasted into the schematic: if it is not then the wrong symbol has been placed for the chosen .SUBCKT (or vice versa) so a different symbol (or .SUBCKT) must be chosen. Note that 'number of pins' here means how many pins, not the pin numbers or names used to describe the nets they connect to in the .subckt netlist; Check that the ORDER of the pins in 'Edit Pin Map information' is exactly the same as in the .SUBCKT pasted into the schematic. This can be very confusing because the pin NAMES may be different between the symbol and the .SUBCKT so it is first necessary to reconcile the two sets of names before attempting to confirm their order. Click OK in the 'Modify your symbol information' dialogue box; Done! This process is illustrated in the following example: [Attaching a .subckt to a symbol 01] [Attaching a .subckt to a symbol 01]:https://easyeda.com/editor#id=808qkCTN5 Some of the EasyEDA symbols such as bjts and all the MOSFETs have a Spice Prefix of 'M' and so are expecting to call a .model statement. To associate a .subckt to a symbol with a Spice Prefix of 'M' there are four stages. So, in the following example, the NMOS_E symbol placed into the schematic from the EasyEDA Libs palette must be edited to change the 'Spice Prefix' of the symbol from 'M' (for a .model defined part) to 'X' (for a .subckt defined part). Place the .subckt text into the schematic and activate it; Place the symbol in the schematic; Change the name of the symbol to exactly the same as the name of the .subckt; Change the 'Spice Prefix' of the symbol from 'M' (for a .model defined part) to 'X' (for a .subckt defined part). The detailed steps to associate a new model to a symbol and to tell EasyEDA that a device model is a .subckt and not a simple .model are: Find a spice .SUBCKT for your target device; Copy and paste it into a text box (the T hotkey) in your schematic (but please respect the EULA and copyright of commercial files); In the right hand properties panel, change the text type from comment to spice; Properties > Text type > spice Place a symbol for the device from the EasyEDA Libs palette onto the schematic; Edit the model name to the exact name of the model in the pasted file; Press the 'I' Hotkey or: Click the blue 'Edit Symbol...' button in the Properties panel: >**Properties > Edit Symbol...** or do: >**Super Menu > Miscellaneous > Edit Symbol** In the 'Modify your symbol information' dialogue box, change the 'Spice Prefix' from 'M' (for a .model defined part) to 'X' (for a .subckt defined part); Check that the NUMBER of pins in 'Edit Pin Map information' is exactly the same as in the .SUBCKT pasted into the schematic: if it is not then the wrong symbol has been placed for the chosen .SUBCKT (or vice versa) so a different symbol (or .SUBCKT) must be chosen. Note that 'number of pins' here means how many pins, not the pin numbers or names used to describe the nets they connect to in the .subckt netlist; Check that the ORDER of the pins in 'Edit Pin Map information' is exactly the same as in the .SUBCKT pasted into the schematic. This can be very confusing because the pin NAMES may be different between the symbol and the .SUBCKT so it is first necessary to reconcile the two sets of names before attempting to confirm their order. Click OK in the 'Modify your symbol information' dialogue box; Done! This process is illustrated in the following example: [Attaching a .subckt to a symbol 02] [Attaching a .subckt to a symbol 02]:https://easyeda.com/editor#id=6OkCwO5nF Another example of the process described above to change the Spice Prefix of a symbol is illustrated with the same EasyEDA N channel depletion mode MOSFET symbol from the EasyEDA Libs that was used earlier with the IXTT20N50D .model statement. In this example the MOSFET symbol is attached to a .subckt that has been created from the orignal IXTT20N50D .model statement in order to wrap up the L=2E-6 W=5.5 parameters and so make using the original model easier. [An N-channel depletion mode MOSFET using an EasyEDA .subckt] [An N-channel depletion mode MOSFET using an EasyEDA .subckt]:https://easyeda.com/editor#id=sHBTNtZhz **Attaching models to custom symbols** This is basically the same as attaching a model to any of the predefined symbols from the EasyEDA Libs except that the symbol is one that has been created from scratch or by editing an existing symbol. The rules for assigning and checking that the spice prefix matches the type of model to be attached ('M' for .model or 'X' for .subckt) and checking that the spice pin numbering matches that of the type of device defined by the .model statement or by the pin sequence of a .subckt defined model.
Reply
BRUNEL 9 years ago
I am trying to put a zener diode in circuit but when I run the DC sweep I get the following message so I must be doing something wrong. Circuit: test Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Fatal error: DCtrCurv: source / resistor 1 not in circuit doAnalyses: no such device dc simulation(s) aborted Error(parse.c--checkvalid): volprobe1: no such vector. ngspice-26 done If it helps the Netlist is as follows: test XD2 VOLPROBE1 GND BZX84C3V0LT1 V3 V3_+ GND 20 R1 V3_+ VOLPROBE1 1k .param pi = 3.141593 .func LIMIT(x, y, z) {min(max(x, min(y, z)), max(z, y))} .func PWR(x,a) {(MAX(ABS(x), 1e-313))**a} .func PWRS(x,a) {sgn(x) * PWR(x,a)} .func stp(x) {u(x)} .func log10(x) {ln(x)/ln(10)} .func SQRT(x) {(MAX(x, 1e-313))**0.5} .func INT(x) {sgn(x)*floor(ABS(x))} .func URAMP(x) {max(x,0)} .func POW(x,a) + {(((a-(int(a)))==0)||(sgn(x)>=0))*( max(exp(ln(uramp(x))*a),0) + + (2*(0.5-ABS((int(a))-2*int(a/2))))*max(exp(ln(uramp(-1*x))*a),0) )} ******************************** * Copyright: * * Vishay Intertechnology, Inc. * ******************************** * Technology: DISCRETE Zener DIODE * Device: Diode * Description: * Type: Typical (nom) * Model established: 04.2008, by Harald Stix, VSA/ASSP-VOE * Wafer: * Remarks: * Revision: 04.2008 * Simulation Model: * Simulator: PSPICE * BZG03C12 D model * created using Parts release 8.0 on 04/2008 * Parts is a MicroSim product. .MODEL BZG03C12 D + IS=5.4821E-12 + N=1.7888 + RS=69.717E-3 + IKF=364.19 + CJO=1.0049E-9 + M=.44713 + VJ=1.0204 + ISR=32.362E-9 + BV=12.707 + IBV=74.641E-3 + TT=1.4427E-6 *$ .SUBCKT bzx84c3v0lt1 2 1 ************************************** * Model Generated by MODPEX * *Copyright(c) Symmetry Design Systems* * All Rights Reserved * * UNPUBLISHED LICENSED SOFTWARE * * Contains Proprietary Information * * Which is The Property of * * SYMMETRY OR ITS LICENSORS * *Commercial Use or Resale Restricted * * by Symmetry License Agreement * ************************************** * Model generated on Mar 10, 06 * MODEL FORMAT: SPICE3 * anode cathode *node: 2 1 * Forward Section D1 2 1 MD1 TEMP=25 .MODEL MD1 D IS=5.21532e-16 N=1 XTI=1 RS=0.5 + CJO=4.5e-10 TT=1e-08 * Leakage Current R 1 2 1.53846e+06 MDR .MODEL MDR R TC1=0 TC2=0 * Breakdown RZ 2 3 14.6948 IZG 4 3 0.24 R4 4 3 3500 D3 3 4 MD3 TEMP=25 .MODEL MD3 D IS=2.5e-12 N=2.76529 XTI=0 EG=0.1 D2 5 4 MD2 TEMP=25 .MODEL MD2 D IS=2.5e-12 N=10.6468 XTI=0 EG=0.1 EV1 1 5 6 0 1 IBV 0 6 0.001 RBV 6 0 -1158.4 MDRBV .MODEL MDRBV R TC1=0.00196824 *-- SPICE3 DIODE MODEL DEFAULT PARAMETER * VALUES ARE ASSUMED *IS=1E-14 RS=0 N=1 TT=0 CJO=0 *VJ=1 M=0.5 EG=1.11 XTI=3 FC=0.5 *KF=0 AF=1 BV=inf IBV=1e-3 TNOM=27 .ENDS bzx84c3v0lt1 .control dc 1 0 20 1 probe V(VOLPROBE1) quit .endc .END Any help would be appreciated!
Reply
andyfierman 9 years ago
Hi John, Sorry but Markdown has trashed your netlist. If you want to post things like netlists or EasyEDA Source files then please prefix the text with a line containing only four tilde characters `~~~~` above the first line and the same again below the end of the last line. Then it will look like this: ~~~~ * An example of quoting a block of text as code * without Markdown interpreting **all** the various > symbols such as **, *, ~, #, >, and so on as * emphasis, italics etc. ~~~~ For future reference, you do not need to post the netlist. Your circuit is public so all you have to do it click on the green share symbol: <https://easyeda.com/Doc/Tutorial/share.htm#SharetoPublic> then copy and paste the url of the **Active file**: <https://easyeda.com/file_view_test_r8I42o8qj.htm> **Now, to fix your problem.** The only mistake is that you have misquoted the voltage source that you want to sweep. In your example this is **V3** You said: >`.dc 1 0 20 1` What you should say is: >`.dc V3 0 20 1` Fixed! :)
Reply
BRUNEL 9 years ago
Great, thanks for your help.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,建议访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice