You need to use EasyEDA editor to create some projects before publishing
Different results simulating the same netlist under EasyEDA and ngspice
2694 14
joaoff 7 years ago
Hi! I obtained the below strange result simulating the operating point of the schematic fully_differential_unity_gain_buffer of my multisheet project LIA_testboard (https://easyeda.com/editor#id=t3leUc60i). *********** EasyEDA result *************** Operating Point Simulation results: +3v: -0.033617981192V voltage v(volprobe3): -0.01209V voltage v(volprobe4): -0.01209V voltage Circuit: fully_differential_unity_gain_buffer Doing analysis at TEMP = 27.000000 and TNOM = 27.000000 Warning: v2: no DC value, transient time 0 value used Warning: v3: no DC value, transient time 0 value used No. of Data Rows : 1 ngspice-26 done *********** EasyEDA result *************** I then generated the netlist and copied it to http://www.ngspice.com/index.php and just changed the .control block by the .op command, as this web interface to ngspice do not support the .control block and simulated, obtaining the expected result. *********** ngspice result *************** 0 v(volprobe2) voltage 0 2.995575136386290e+00 32 v(volprobe4) voltage 8.990835684303878e-01 34 v(volprobe3) voltage 8.991239566547913e-01 104 v(volprobe1) voltage 1.797849754862354e+00 *********** ngspice result *************** Is this a bug? or am I doing, one more time, something wrong?
Comments
andyfierman 7 years ago
I have taken the netlist from your circuit, edited it to remove the .cotrol, .endc and quit commands and then just run a .op on ngspice.com: http://www.ngspice.com/index.php?public_circuit=7WXhAW and get: 0 v(+3v) voltage 0 -3.361798119157237e-02 : : 32 v(volprobe4) voltage -0.0120866524 : 34 v(volprobe3) voltage -0.0120921028
Reply
andyfierman 7 years ago
(Accidentally posted before completion...) Compared to EasyEDA: Operating Point Simulation results: +3v: -0.033617981192V voltage v(volprobe3): -0.01209V voltage v(volprobe4): -0.01209V voltage The results from ngspice.com are different from your results but are pretty much the same as from EasyEDA. There is a very slight difference between the two volprobe results but that is explained by the number of significant figures displayed in EasyEDA. If the ngspice values are rounded to the same sig figs then the results are in fact identical. Soooo, I suspect you may have had an attack of finger trouble... I have used ngspice extensively in developing several models and have always found the results to be pretty much identical from there and from running the same netlist in EasyEDA. You can expect to get quite markedly different results between different variants of SPICE such as for example LTspice and ngspice because different simulators are set up differently or use slightly different algorithms to do the calculations or the default options may be set differently. Another one to watch out for is that some simulators ignore different parameters in device models too. :)
Reply
joaoff 7 years ago
Hi, Andy! I discovered what happened. When generating the netlist, you have two options: 1) Miscellaneous > Netlist for Document > Spice... 2) Miscellaneous > Netlist for Project > Spice... When you choose the first option, just the active schematic is netlisted. When you choose the second option, all project is netlisted (all schematic sheets). Simulating the netlist outputed by the first option, I obtain your result (EasyEDA result). Simulating the netlist outputed by the second option, I obtain the expected result, as the complete circuit (all schematics) are netlisted. Is this the expected behaviour (simulate just the active schematic sheet)? Particularly, I expected that the entire project was simulated. Cordially, João.
Reply
joaoff 7 years ago
ps: or, maybe, a better option would be ask the user if he wants to simulate just the present schematic sheet or the entire project.
Reply
andyfierman 7 years ago
`...a better option would be ask the user if he wants to simulate just the present schematic sheet or the entire project.` Er, but we do: ![enter image description here][1] For more information please also see: **Advanced probing and simulation control:** https://docs.google.com/document/u/1/d/1OWZVVFRAe_2NW3WratpkA_SGuHa5AcRow5ZRfvcoVTU/pub#h.4i7ojhp **Setting up analyses:** https://docs.google.com/document/u/1/d/1OWZVVFRAe_2NW3WratpkA_SGuHa5AcRow5ZRfvcoVTU/pub#h.3fwokq0 (The Google links above are to the original copy of the Simulation eBook which you can also find at: https://easyeda.com/Doc/Simulation-eBook/ but the table of contents in the EasyEDA copy is broken and misses out some sections. We are working to fix it but in the meanwhile the copy published to the web from Google Drive works just as well.) :) [1]: /editor/20160429/57230b2a8fc72.png
Reply
andyfierman 7 years ago
BTW, Well done on getting the AD8476 model into your schematic though I'm not sure of the copyright or license status of it since I can't tell where you got it from. :) I have now put a verbatim copy of the AD8476 subckt directly from Analog Devices (this is to comply with AD's license agreement) into the EasyEDA library so if you change the name in your schemtic from AD8476ARMZ to AD8476, it will run without having to paste the model into the schematic. BTW, I hadn't noticed it before but of course simulating the sheet on it's own means that the device has no +3V supply because I guess that is on another sheet.
Reply
joaoff 7 years ago
Hi, Andy! I will take the time now to read the simulation ebook. In the project there is a schematic sheet with the voltage regulators and another schematic sheet with the buffer. Both schematics are connected through ground and the +3V power supply rails. Concerning the AD8476 model, I downloaded it from the Newark site. The file direct link is: http://www.farnell.com/simulation/1738302.zip (you need to register the site to download). The model can also be downloaded from AD site (http://www.analog.com/en/design-center/simulation-models/spice-models.html), as well as a lot of other models. To not clutter even more the working area, I cut the comments at the beginning of the model file. I paste below the cut lines. The mentioned link to the license statement is not working, but it will shown when you download the model from AD site. For the model to work, I changed all + and - signs in parameter names by, respectively, (_)plus(_) and (_)minus(_) (please, see https://sourceforge.net/p/ngspice/discussion/120973/thread/5addba4b/). I also changed the model name to be equal to the symbol name. Sometimes, for a model to work properly, I have to swap the order of some pins. As you know, this can be done in the model or in the symbol properties (Edit Symbol > Modify symbol information > Edit Pin Map information). For me it is easier to do this in the model but, maybe, the correct would be to change it in the symbol properties. I've done this, for example, for the adjustable current source lm334 model (https://easyeda.com/editor#id=qoiASasJ1), whose model I obtained from http://ltwiki.org/files/LTspiceIV/lib/sub/regulators.lib. It can also be obtained from https://www.physicsforums.com/threads/control-design-for-pwm-converter.798541/page-2. Probably you know all this, but ... it is just to give a complete answer. Thank you for the answer! João. * AD8476 SPICE Macro-model * Description: Amplifier * Generic Desc: Low Power, Unity Gain (resistors integrated), Fully Differential Precision Amplifier and ADC driver. * Developed by: Bin Zhang * * Revision History: * 1(05/2012) - B.Zh Initial Rev * A(11/2012) - F.B ( Modified pinout to match datasheet. Fixed errors from first rev.) * S.H ( Updated to new header style.) * Copyright 2012 by Analog Devices, Inc. * * Refer to http://www.analog.com/Analog_Root/static/techSupport/designTools/spiceModels/license/spice_general.html for License Statement. Use of this model * indicates your acceptance of the terms and provisions in the License Statement. * * * BEGIN Notes: * * Not Modeled: * Temperature effects * Harmonic Distortion * Pulse Response variation with cap load * * Parameters modeled include: * Supply current varies with power supplies * Bandwidth * Slew rate * CMRR over frequency * Output range * Small signal pulse response * * Supply range: * Single Supply: 3V to 18V * Dual Supplies: +/-1.5V to +/-9V * * Bandwidth sensitive parameters: G1, C1, C2, G3, G4 * CMRR sentitive parameters: C11, C13, C12, C14, R14, R15 * Slew rate sensitive parameters at G10,G11: .005 in VALUE={LIMIT(1*V(VX1,VY1),.005,.005)} * Noise sensitive parameters: R13, L1 for roll-off; R1,R2,R15,R20 for noise floor * Other parameters commented in each simulation section below * * END Notes * * Node assignments * Negative input * | Postive Supply * | | Output Common Mode Adjust * | | | Non-inverting Output * | | | | Inverting Output * | | | | | No connect * | | | | | | Negative Supply * | | | | | | | Positive Input * | | | | | | | | * | | | | | | | | * | | | | | | | | .SUBCKT AD8476 INN +VS VOCM +OUT -OUT NC -VS INP
Reply
andyfierman 7 years ago
Hi João, Thanks for the explanation. The model from the Newark site is an earlier version of the one from the AD site. I had to edit the `+vos` and `-vos` nets to `pvos` and `nvos` to keep ngspice happy but that was the only change necessary. If you search EasyEDA for `hetashrim`, you'll find a lengthy thread about simulation over more than one sheet that may fill in some of the gaps. I have found Helmut Sennewald's LM334 model some years ago and in fact ported it to CircuitLab whilst also developing a behavioural model too. That behavioural model is the basis of the one that is in the library for EasyEDA. IIRC, if you search EasyEDA for `LM334` or `Current source`, you should find an example sim using the LM334 model. :)
Reply
andyfierman 7 years ago
Here's the LM334EE model in action, with some friends... https://easyeda.com/example/Current_source_devices-EFztNHZhy
Reply
joaoff 7 years ago
Hi, Andy! Thank you for the answer. I've found the mentioned thread about multi sheets simulation and I will read. Concerning the simulation e-book, I think that you intended to show that the fourth circuit in the "All simulation schematics MUST have a power supply too" example (https://www.google.com/url?q=https://easyeda.com/editor%23id%3D4ke8qIZTb&sa=D&ust=1462066695732000&usg=AFQjCNFZb8ekjpWkokEf56YrI82fJvZ7IA) was not powered, but it is powered by the third circuit, because of the "battpos3" netlabel. So, I imagine that the netlabel should be "+9V". I see that your model for the LM334 is very different from that of Helmut Sennewald. To bias my circuit, I need a 1 uA current for a Vpn slightly bigger than 0.6V. According to Figure 11 of datasheet, it is possible. I will simulate this to see how the models will behave. I have a last silly question. Why the "EE" after the lm334 model name? there's no such option in the datasheet and, apparently, you don't use any options in the model names. Thank you! João.
Reply
andyfierman 7 years ago
Helmut's LM334 model is modelled at the physical device level. The EasyEDA model is at an abstracted behavioural level. Behavioural models usually run faster than detailed device level models. The `EE` suffix is to indicate that the model is an in-house SPICE model. As part of my supporting work for EasyEDA, I have developed many, often unique, in-house models. Some have been developed because they do not exist outside of any closed commercial library and others to avoid any possible copyright issues. Models with no `EE` suffix are usually vendor models. Some have suffixes to indicate which vendor. In general, SPICE models are not package or version specific; for example, the AD8476 model used in your sim is package independent. Also, models are rarely different forsingle or dual devices such as for the LMC6482 dual opamp. I have built a subckt for a dual version of this device but only so it works with an 8 pin schematic symbol. The underlying device model is identical. :)
Reply
andyfierman 7 years ago
`Concerning the simulation e-book, I think that you intended to show that the fourth circuit in the "All simulation schematics MUST have a power supply too" example (https://www.google.com/url?q=https://easyeda.com/editor%23id%3D4ke8qIZTb&sa=D&ust=1462066695732000&usg=AFQjCNFZb8ekjpWkokEf56YrI82fJvZ7IA) was not powered, but it is powered by the third circuit, because of the "battpos3" netlabel. So, I imagine that the netlabel should be "+9V".` Thanks for pointing that out. You're right and I have now corrected the example.
Reply
joaoff 7 years ago
Nice! and thanks for the clarification!
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