Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
EAGLE Forum
Welcome to Autodesk’s EAGLE Forums. Share your knowledge, ask questions, and explore popular EAGLE topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simulation - is it ready for prime time?

11 REPLIES 11
Reply
Message 1 of 12
engineeringNCMXB
1874 Views, 11 Replies

Simulation - is it ready for prime time?

I slogged through the 83 minute webinar on simulation in Eagle. It seems like it can cover a lot of territory during the circuit design phase. At the moment, I am still using LTSpice to simulate relatively small sections of my designs. I am not an expert, but I know it well enough to get the answers I need fairly quickly. 

After trying Eagle ngspice simulation - I have been bombarded with errors and lack of any usable generic library to get a design started. 

eagle_addmodel_cpp-err_A.png

Trying to add-model to a battery symbol only gives me the option to pick from MOSFET models. 
The example models cover very little territory and do not seem to have any attributes associated so I am left to just pick from a cryptic list and wonder what the model is for. 

How do you best manage a spice library of typical parts? Is there a place to download a reasonable starter library for conceptual level designs? 

Full disclosure: I have only spent about 2 hours looking at the simulation so far, so my understanding is clearly very limited. With that in mind, what I have seen so far makes me want to run away as fast as I can. I do NOT want to spend a pile of time attempting to learn a system that I will ultimately deem worse than LTSpice (which is already a comically clunky piece of software - but FREE). 

In the end - all I really want is the fastest possible path to getting answers while I design a new circuit. Has anyone dug into Eagle simulation enough to compare it to LTSpice, PSpice, Tina, etc, etc? Is it worth what appears to be a considerable learning curve and establish a usable library?


 

Carlos Acosta
Factory400 - YouTube|Instagram
11 REPLIES 11
Message 2 of 12

How do I add/place/define a voltage source? Intuitively - I would just pick a voltage source and define its parameters. In this case, I tried to add-model to a generic battery, but my only options are unrelated to a voltage source. 

Added a generic battery to SCHAdded a generic battery to SCHOnly options in SPICE......Only options in SPICE......

Carlos Acosta
Factory400 - YouTube|Instagram
Message 3 of 12

After a few more HOURS.....I still have not been able to figure out a voltage controlled switch in a simulation. 

While I am sure this is 'easy' after someone knows how to do it.....it is not intuitive. To be fair, LTSpice is FAR from intuitive, yet it took about 3 minutes to sort out a voltage controlled switch. After I know how to set them up, I can add them in seconds. 

If a switch is this much of a pain, I really don't want to bother with a circuit worth simulating. There is a non-zero chance that I am a total moron - but my opinion is that any moron should be able to add a switch to a simulation within minutes even if they have never done it before. 

Here I have an error on line 20, but the netlist has no line numbers. Still not sure why I need to even mess with a model and net definitions for a voltage controlled switch. Last time I looked at the calendar, it is 2018. 
eagle_vcs_a.png

Carlos Acosta
Factory400 - YouTube|Instagram
Message 4 of 12
edpataky
in reply to: engineeringNCMXB

Thanks for the info .. you are right, sometimes something that is not 100% intuitive can completely frustrate you, so it is important we know where those points are for users .. i will read through your comments above carefully and respond shortly.  

Message 5 of 12
edpataky
in reply to: engineeringNCMXB

OK, a lot to unpack, and thanks for all the feedback.  Responses to each comment below: 

 

>> I slogged through the 83 minute webinar on simulation in Eagle. It seems like it can cover a lot of territory during the circuit design phase. At the moment, I am still using LTSpice to simulate relatively small sections of my designs. I am not an expert, but I know it well enough to get the answers I need fairly quickly.  After trying Eagle ngspice simulation - I have been bombarded with errors and lack of any usable generic library to get a design started. 

 

Webinar length is hard to set properly .. if too short it does not cover enough, too long and it feels like “slogging” as you put it .. agree .. the last one I did with Jorge was fairly comprehensive i thought but still there was more we did not cover .. anyway let’s get to the questions .. 

 

About the usable libraries .. ngspice-simulation has analog parts ready to use, and ngspice-digital has digital parts and some A/D, D/A parts .. we have also provided something like 20 examples using those parts (including the ones you asked about below) - you can find these under /examples/ngspice/ in the install directory or in the control panel in eagle, when “include examples” is checked on the Directories dialog. 

 

>> Trying to add-model to a battery symbol only gives me the option to pick from MOSFET models. 

The example models cover very little territory and do not seem to have any attributes associated so I am left to just pick from a cryptic list and wonder what the model is for. 

 

A couple points here:

  • Example models - agreed .. we supply only some basic models to get started, like the DMOD model, or NFET or PFET models, but since there are literally (tens of) thousands of models out there, we did not try to curate and collect models for you.  In the best case, you might find some models useful for you, but as you probably know with simulation, it is all about the models, and getting an accurate result depends on you having the right model for the part you are actually using, from the manufacturer that supplies it to you.  So even if we have say 10,000 models we may not have the one you are looking for, so the 10,000 models is useless if it does not include yours.  We decided to only provide simple basic models to start with.  We may provide some widely used libraries in the future, but for now, you supply the models, we will verify them and support them if they are in standard SPICE format.  (even sometimes i help users on the forums convert models that are not pure SPICE but are unencrypted tool-specific models, but on a case by case basis if not too difficult to convert)
  • About the battery symbol, this is not the case and I will explain how it works:
    • EAGLE allows full flexibility to allow you to simulate any circuit, using any symbol, as long as you configure the schematic properly.  For example maybe you have a schematic from 20 years ago made in an old version of EAGLE .. no problem, just map spice models to the parts and you are ready to go .. i will explain how it works here, but it is also in the video webinar you noted above https://www.youtube.com/watch?v=BCpYbKRfPa4&t=1s 
    • start with the spiceconvert.sch example, which is made for the purpose of explaining how adding models works
    • that schematic looks like this: http://prntscr.com/l6dz9p
    • right click on the battery, choose “Add Model”
    • You need to choose the right type for the part .. in this case, it is a independent voltage source, so choose that option http://prntscr.com/l6e0b9   Note that the possible choices in this list depend on the number of pins for the symbol .. so for example for a 2 pin battery symbol, it is not possible to see the MOSFET as a choice, because a MOSFET has more than 2 pins. 
    • You may change the value here if you like, but this dialog does not care about the value, this is only for mapping, for a voltage source, there is a wizard (right click on it in sch) so it is better to do there, i would just clear out the value for now in this dialog, since the lib part came with some value that is not usable for simulation (it is a string description not a simulatable value like 1V for example)
    • click MAP - the mapping dialog lets you connect any arbitrary symbol pins, to the inputs/outputs the SPICE model expects .. click OK to verify the proper mapping: http://prntscr.com/l6e38v
    • That is it for the battery and other parts are similar.  Personally i like to select all parts, then run Add Model, then I can do all the mapping from one table-based dialog and by running Add Model only one time - see here:  http://prntscr.com/l6e4an
    • Note also, depending on the Spice Type you choose in the Add Model dialog, the MAP dialog will look different . if you choose a type that does not require a model, you will be brought to the pin connection mapping tab and that is all you need to do .. (for example for resistors, capacitors, or other parts that do not require a model at all) … if the type requires a model file, then it is either a “model card” or a “subcircuit” .. so you need to load the appropriate model for the part type, and as you noted, you do need to know what is required for the part.  This is not automatic because there is no way for EAGLE to know what type of part you have, unless you tell it .. for example you can draw a symbol of a CAR, put two pins on it, and it can be mapped to a resistor, capacitor, any valid type that requires two pins.  The point here is, it cannot all be automatic, because there is nothing inherent about any symbol that will tell the simulator what it is, you need to tell it.  Of course many tools supply ready to use parts, as we do .. for parts we already mapped and supply (like all those in ngspice-simulation, or ngspice-digital, or in misc passive libraries) the type is known, but for arbitrary parts not yet mapped for simulation, you need to go through the Add Model process to ready the schematic

 

 

>> How do you best manage a spice library of typical parts? Is there a place to download a reasonable starter library for conceptual level designs? 

 

Look into ngspice-simulation and ngspice-digital, also libraries like rcl that have all passive parts mapped.  These libraries have ready-to-simulate parts and the many examples provided with EAGLE show their usage 

 

>> Full disclosure: I have only spent about 2 hours looking at the simulation so far, so my understanding is clearly very limited. With that in mind, what I have seen so far makes me want to run away as fast as I can. I do NOT want to spend a pile of time attempting to learn a system that I will ultimately deem worse than LTSpice (which is already a comically clunky piece of software - but FREE). 

 

Well let’s try to fix that .. there are likely just a couple points of confusion, where we can do better, but I will try to explain the basic processes here  ..   

 

>> In the end - all I really want is the fastest possible path to getting answers while I design a new circuit. Has anyone dug into Eagle simulation enough to compare it to LTSpice, PSpice, Tina, etc, etc? Is it worth what appears to be a considerable learning curve and establish a usable library?

 

Valid points made .. of course we have to compare to what is available regularly .. one point is that we use NGSPICE, which is open-source, and generally follows standard SPICE usage that has been valid and proven for decades.  Without naming names, those other tools use encrypted models, or non-standard and non-SPICE model parameters because they want to try to force you to use their tools.  In our opinion, the best case is when you are able to download pure SPICE models from the manufacturer, and simulate without any tool-specific weirdness .. unfortunately, some of these tools have been successful in convincing manufacturers to supply only their models (for example you can find PSPICE models in many places), but this severely limits you.   It is best to stick with manufacturers that provide standard, pure SPICE models so you are not locked into using any one tool.  (pretty much ALL tools are able to use pure SPICE format models). 

 

>> How do I add/place/define a voltage source? Intuitively - I would just pick a voltage source and define its parameters. In this case, I tried to add-model to a generic battery, but my only options are unrelated to a voltage source. 

 

Not true and it is very simple.  Make sure the part is mapped as a independent voltage source, and then right click on the part and choose “Analog Source Setup”.  This wizard is specific to independent sources (also exists for independent current sources), and it was made to make your life easy .. set DC, AC, and transient parameters like (SIN, PULSE, other functions).  You can always also enter any valid value into the part outside of the wizard, by just using VALUE command (for example if you want to enter PWL data, you can do it there, it is not in the wizard yet)

 

See example of source setup dialog here:  http://prntscr.com/l6eopv

 

>> After a few more HOURS.....I still have not been able to figure out a voltage controlled switch in a simulation. 

 

There is an example called vswitch.sch made to show how this works.  http://prntscr.com/l6epbb  There is really nothing to do, just place the part and connect it up, it should work just fine.  Note that the part used in the library is mapped to the model called VSMOD and running SIM to view the netlist will show you the model, copied here:

.MODEL VSMOD SW(VT=1V VH=0 RON=1e-3 ROFF=1e12)

 

This model has a threshold voltage of 1V, and you can set other parameters as well.  Note that all the parameters possible for each model type are described in the ngspice manual in more detail.   

 

 

>> While I am sure this is 'easy' after someone knows how to do it.....it is not intuitive. To be fair, LTSpice is FAR from intuitive, yet it took about 3 minutes to sort out a voltage controlled switch. After I know how to set them up, I can add them in seconds. If a switch is this much of a pain, I really don't want to bother with a circuit worth simulating. There is a non-zero chance that I am a total moron - but my opinion is that any moron should be able to add a switch to a simulation within minutes even if they have never done it before. 

 

Agreed and understood, again though, it should not take more than a few seconds to use the switch provided, or to make your own. 

 

 

>> Here I have an error on line 20, but the netlist has no line numbers. Still not sure why I need to even mess with a model and net definitions for a voltage controlled switch. Last time I looked at the calendar, it is 2018. 

 

Ok so here it cannot find your model .. it means you either did not map the part, or maybe you moved the schematic but forgot to move the models with it, or maybe you tried to map the part manually?  I cannot tell, but there should be no problem using your switch model if you map it and provide the model properly .. do this .. right click on the part, choose Remove Model (if one exists) and map it again with the information above and let me know if still any issues, and i can help. 

 

Message 6 of 12
Anonymous
in reply to: edpataky

I'm definitely having similar issues - this SPICE system doesn't really work.

 

first, the instructions for adding a spice model to a library component tell me to push the Add Model button but there isn't one.  I tried to type various things into the model dialog box but it didn't seem to like any of them.  

spice fail 1.pngAfter I gave up on that I created a small schematic and pushed the LTSPice model (or Export Setup) button but it just came up and said, "LTSpiceIV (scad3.exe not found.)

 

At this point I gave up.

 

How soon until you have a stable system?

 

Thanks,

 

 

 

Message 7 of 12
edpataky
in reply to: Anonymous

in the screenshot you posted note the part is not mapped (the exclamation point should be a green check mark) .. you need to click the MAP button to map the part, then you will be able to add a model, assumming you choose a type that requires one. 

 

A VALUE field is there for convenience .. for example for a resistor or capacitor, you can enter the value of the part (independent of mapping) .. for your transistor .. there is nothing to enter in the VALUE or MODEL fields, just move ahead to map the part.  

 

I would also note, it looks like you are on an older version .. the dialog should look like below.  I would try with the latest version as there have been many changes since the version you are using.  

Screenshot at Oct 30 11-49-13.png

Message 8 of 12
Anonymous
in reply to: edpataky

Thank you Ed,

from the way the UI was laid out I was assuming that I didn't press the map button until after I got the green check.

 I pressed the MAP button and tried to select PFET but I go the following error message:

spice fail 2.png

I'm on 9.2.2, is there a newer version? 🙂

 

DougM

 

 

Message 9 of 12
edpataky
in reply to: Anonymous

No that is the latest .. are you in the library editor or schematic? I probably forgot if the columns are dynamic based on the editor .. it would make sense .. a out the unexpected condition, we will try to reproduce it .. so you loaded a PFET model and it crashed? I will check it out

 

fyi do not use Ltspice features .. there are some bugs and we will not support it going forward .. use the native built in simulation ., i will look at what is going on 

Message 10 of 12
Anonymous
in reply to: edpataky

I'm in the library.

 

So I switched over to the schematic and used the Add Model button to add models for each component in a simple p-fet switch:

spice fail 3.png

and mapped all the components, but in the map to model dialog as soon as I click Map to Model (PFET.mdl) I get a similar error (addspicemodel.cpp line 499)

 

Thanks,

 

 

Message 11 of 12
edpataky
in reply to: Anonymous

OK I understand ... i thought we addressed this issue previously but i think if you check your settings, and make sure to turn on "Include Examples" in the Directories dialog, that problem will go away .. i need to check what is going on with that one because i thought we addressed it .. i will look into it again, thank you. 

Message 12 of 12
edpataky
in reply to: edpataky

Thanks for the info the issue is verified, it will be fixed in the next release .. for now just turn on "Include Examples" and it should not crash .. this same issue was fixed but in a different place for a different workflow, but this one was missed .. the fix for that is done and will be out with the next EAGLE version 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report