How do I create a custom component from a Spice subckt?
299 10
pmi123 2 months ago
Just started using EasyEDA. I googled and searched the forums for how to link a Spice subckt to a component and I have some questions. The easy answer seems to be to add some "spice" text to the schematic and link that to the part name. However, I cannot figure out how to format that text so it retains the CRLF and is readable as a text field. I have seen examples of the model or subckt text that retains the CRLFs, so I know it is possible. How do I do that? I would really rather create a new component that has the spice model and just add that to the schematic instead of lots of random text on the schematic. How do I do that? My spice model for a n-channel mosfet. I think there may be an issue with a Spice3 model from reading other posts, so do I need to change it somehow? `.SUBCKT irlz34n 1 2 3` `**************************************` `*      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 Apr 24, 96` `* Model format: SPICE3` `* Symmetry POWER MOS Model (Version 1.0)` `* External Node Designations` `* Node 1 -> Drain` `* Node 2 -> Gate` `* Node 3 -> Source` `M1 9 7 8 8 MM L=100u W=100u` `* Default values used in MM:` `* The voltage-dependent capacitances are` `* not included. Other default values are:` `*   RS=0 RD=0 LD=0 CBD=0 CBS=0 CGBO=0` `.MODEL MM NMOS LEVEL=1 IS=1e-32` `+VTO=2.09128 LAMBDA=0.00659881 KP=14.4595` `+CGSO=8.22043e-06 CGDO=2.94451e-07` `RS 8 3 0.0236528` `D1 3 1 MD` `.MODEL MD D IS=5.31057e-13 RS=0.00899451 N=1.01104 BV=55` `+IBV=0.00025 EG=1 XTI=1 TT=5.00772e-08` `+CJO=5.88011e-10 VJ=1.06884 M=0.467851 FC=0.5` `RDS 3 1 2.2e+06` `RD 9 1 0.0001` `RG 2 7 7.24763` `D2 4 5 MD1` `* Default values used in MD1:` `*   RS=0 EG=1.11 XTI=3.0 TT=0` `*   BV=infinite IBV=1mA` `.MODEL MD1 D IS=1e-32 N=50` `+CJO=7.15463e-10 VJ=0.5 M=0.630172 FC=1e-08` `D3 0 5 MD2` `* Default values used in MD2:` `*   EG=1.11 XTI=3.0 TT=0 CJO=0` `*   BV=infinite IBV=1mA` `.MODEL MD2 D IS=1e-10 N=0.411212 RS=3e-06` `RL 5 10 1` `FI2 7 9 VFI2 -1` `VFI2 4 0 0` `EV16 10 0 9 7 1` `CAP 11 10 1.74606e-09` `FI1 7 9 VFI1 -1` `VFI1 11 6 0` `RCAP 6 10 1` `D4 0 6 MD3` `* Default values used in MD3:` `*   EG=1.11 XTI=3.0 TT=0 CJO=0` `*   RS=0 BV=infinite IBV=1mA` `.MODEL MD3 D IS=1e-10 N=0.411212` `.ENDS` Thanks for any guidance you can offer!
Komentáře
pmi123 2 months ago
I have made some progress. 1\. I figured out that I have to manually add a '\n' at the end of every line after I paste the text for the subckt\. Is there a better way to format the text on the sheet? 2\. After formatting the subckt text\, the simulation would not run\. I checked some other tutorial examples\, and I found that in the examples\, the component symbol had a Spice designation of X \(it was originally Q\)\. When I changed the Q to X\, the simulation started working\. Is this the right approach? 3\. I still get a warning before the simulation run \- "There are some parts haven't spice model\, please use "EELib" and "SPICE Symbols" at "Libraries" of "Simulation" mode\, or you can assign the spice model for them: XQ1: IRLZ34N"\. I don't understand the warning or how to fix it\. Thanks! <br> <br>
Odpovědět
andyfierman 2 months ago
It's all much easier than you describe... To enter Text in a simulation (active) or non-simulation (passive) Schematic or in a PCB: 1. Place a Text block in the canvas; 2. Double click on it;  3. Enter a line of text 4. Press **CTRL+ENTER** to create a new line;  5. Repeat steps (3) and (4) as required; 6. Press **ENTER** to exit text editing and place the edited text in the canvas. To append a model file to a spice symbol: Open the symbol in the Spice Symbol Editor; **Edit > Spice Model...** ![image.png](//image.easyeda.com/pullimage/nvlBZ0wqLAcZVtG3si7vdeldZJn2rHp8CAjQyJdN.png) which opens: ![image.png](//image.easyeda.com/pullimage/tt0cxS7DSbtatciLlTMXGNB7zPI4Q4dO2CF1N2gQ.png) * This works for .subckt based models as long as the symbol spice prefix is set to X. * I think this works for .model based models if you change the symbol spice prefix from X to the appropriate prefix for the model type. For more simulation help see: [https://docs.easyeda.com/en/Simulation/Headings/index.html](https://docs.easyeda.com/en/Simulation/Headings/index.html) models
Odpovědět
andyfierman 2 months ago
Note that although your spice symbol will become publicly available for everyone, the steps described above only appends the model file to your spice symbol. If anyone else uses your symbol, they will have to append their onw copy of the model file. BTW: sp3 syntax models can be read without modification by LTspice used in EasyEDA.
Odpovědět
pmi123 2 months ago
Thanks for your reply. I tried CTRL_ENTER, but whenever I press CTRL while the text edit box is open, the text box closes and pastes the text to the schematic. I had read in one of the simulation tutorials that SPICE3 files had to be "fixed". Not sure which one. However, I am able to run the simulation, so I ignored that concept. :) I don't have an edit > spice model option: ![Screenshot from 2021-10-29 14-33-15.png](//image.easyeda.com/pullimage/4wkIKUdf542kuxMd7wZ412cXPwQ2uQyGu6l7EDRS.png) When I right click on the component, there is an Edit Symbol option, but it only allows me to change the pin numbers. ![Screenshot from 2021-10-29 14-34-24.png](//image.easyeda.com/pullimage/j6LYgWlVewRUoea1AJqXElZ1MiLUUgCNDBeXRh8S.png)
Odpovědět
andyfierman 2 months ago
Please post screenshots or an animated gif showing exactly how and where you are editing the text. Your screenshot is of the Schematic Editor. Please read my post carefully. I said:    Open the symbol **_in the Spice Symbol Editor_**; **   Edit > Spice Model...**
Odpovědět
andyfierman 2 months ago
"...whenever I press CTRL while the text edit box is open, the text box closes and pastes the text to the schematic." I cannot reproduce this. Check your key mappings on your machine and reset your Hotkey settings back to their defaults in EasyEDA?
Odpovědět
pmi123 2 months ago
@andyfierman I did read your post very carefully. I have no idea how to open my component in the Spice Symbol Editor. It is not an option in my drop down menus, which is what I was trying to showing you. It makes no difference if I select Simulation Mode or Standard Mode. There is no option Edit > Spice Model in my menu tree. I reset the Hotkeys to default in EasyEDA, and the text box still closes when I use the ctrl key. I have not changed any of the default key mappings for Ubuntu. Ctrl-C, Ctrl-V, Ctrl-Z all work properly in EasyEDA and other applications. If I open gedit in Ubuntu, ctrl-enter creates a new line so I believe ctrl-enter is mapped correctly on my OS.
Odpovědět
andyfierman 2 months ago
"There is no option Edit > Spice Model in my menu tree." because you're in the Schematic Editor not the Symbol Editor. There are two ways to open any symbol into the Symbol Editor: 1. If it's in the **EElib**, double-left-click on the symbol in the left hand panel; 2. Search, select it then click **Edit** in the **Libraries** tool. To edit a Spice Symbol you must be in SIM mode.
Odpovědět
UserSupport 1 week ago
@pmi123 You need to create a new Spice Symbol via: Top menu - File - New - Spice Symbol
Odpovědět
andyfierman 1 week ago
@UserSupport, The issue here was not so much that the OP needed to create a new spice symbol but was more that the OP already had a symbol in a schematic to which they wanted to append a spice model. The OP did not understand: 1. How to place text directly into a schematic (in order to paste a spice model into the schematic);  2. That it is possible to add a spice model directly to a spice symbol using the Edit Spice Model menu option;  3. That to do this, they need to be working on the spice symbol in the Spice Symbol Editor and not by selecting it in the schematic. The OP also seemed to have a problem with the use of the CTRL key for entering text in the text box but that may have been because they had not fully understood item (1) above.
Odpovědět
Pro přidání komentáře se musíte Přihlásit nebo Registrovat
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
We use cookies to offer you a better experience. Detailed information on the use of cookies on this website is provided in our Privacy Policy. By using this site, you consent to the use of our cookies.