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: 

Adding a Spice model for a pot

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
philip.leriche
1211 Views, 12 Replies

Adding a Spice model for a pot

I have 6 trimpots in my design. I added the POT spice model to one instance in the schematic, but when I tried adding it to a second instance I got a message "The model card does not include the required .MODEL line" which I didn't understand. And The Goog wasn't any help either.

 

Quite apart from the meaning of that error, it would seem to make more sense to me to add a model to a device in the library, rather than an instance of the device in a schematic but I don't see how to do that. Perhaps that's what actually happens, but if so, why didn't the model show up for the second instance having added it to the first?

Tags (2)
12 REPLIES 12
Message 2 of 13

You definitely can add the spice model in the library. Open the device view for the part in question then there is an add model button in the toolbar down the left hand side. 

 

Best Regards,

 

Rachael

Message 3 of 13

Thank you Rachel yet again - I did manage to add the Spice model to the device, but when I click Add Model on the device in my schematic it still shows it as Spice Type J: JFET.

 

And if I click on Simulate it says I still have unmapped devices, but doesn't tell me which ones are unmapped. How can I tell?

...

 

Right - I selected te whole schematic and clicked Add Model, and the only mapped parts are my 2 TL084 opamps. No R's and C's, nor my trimpots! And what sort of model do I use for audio jacks and power pads??

 

Best regards - Philip

Message 4 of 13


@philip.leriche wrote:

Thank you Rachel yet again - I did manage to add the Spice model to the device, but when I click Add Model on the device in my schematic it still shows it as Spice Type J: JFET.


 

Without looking at your library I'm not sure but I suspect the model just hasn't been mapped correctly.

 


@philip.leriche wrote:

 

Right - I selected te whole schematic and clicked Add Model, and the only mapped parts are my 2 TL084 opamps. No R's and C's, nor my trimpots! And what sort of model do I use for audio jacks and power pads??


 

So for generic parts like R's and C's you still need to set up your libraries to use them. Here is a screenshot from my Passives library showing my SMT resistor part and how the SPICE model is set up. You'll need to go make your libraries similar and then run an update on your design to pull the library changes.

 

image.png

 

Best Regards,

 

Rachael

Message 5 of 13

I managed to map all my passives but these trimpots are still defeating me. I can see the Spice model in the device definition in the library .lbr file but it's not getting picked up in my schematic. A found a thread which suggested I click Library - Update All in the scematic window: no effect. Another thread suggested right-clicking the device and Replace with the same: no effect. If I go nosing in the innards of the .sch file it's clear it's still using an unmapped version from the library.

 

Perhaps I'll go and solder of few LEDS to an odd bit of stripboard, just to destress. 😞

 

Kind regards - Philip

Message 6 of 13


@philip.leriche wrote:

I managed to map all my passives but these trimpots are still defeating me. I can see the Spice model in the device definition in the library .lbr file but it's not getting picked up in my schematic. A found a thread which suggested I click Library - Update All in the scematic window: no effect. Another thread suggested right-clicking the device and Replace with the same: no effect. If I go nosing in the innards of the .sch file it's clear it's still using an unmapped version from the library.


 

So either there is a duplicate library somewhere and it's not picking up changes from the one you think or there is still something wrong with the way the model is mapped in the part so it's not getting pulled in correctly.

 

To check for it updating from the correct library, make a non-functional but obvious change to the symbol and then perform the update. Does you change show? If so it's updating ok and you can revert the change. 

 

If possible maybe you could zip up the library and post it up on here so either myself or somebody else can take a look and see if there is anything wrong in the way it's been mapped?

 

Best Regards,

 

Rachael

Message 7 of 13

I opened the device in the SparkFun library and added "Philip wos 'ere" to the device Description. I then went back to the schematic, did Library - Update All, and on the device in the schematic I did right-click - Open Device. It showed Philip wos 'ere in the Description.

 

I've attached a zip file containing the Sparkfun Resistors (I'm using the TRIMPOT with 3362 footprint) and my schematic and inserted a screenshot of my lbraries below. I hope that gives you a clue - it's just gotta be something stoopid.

 

Kind regards - Philip

Library.png

Message 8 of 13

Ok thanks for sharing the library. I’m on my phone not my laptop again now so will take a look when I have access to EAGLE again in the morning 🙂

 

Best Regards,

 

Rachael

Message 9 of 13

Fantastic, thanks. It's nearly my bedtime and I'm out most of tomorrow so will look forward to seeing what you come up with in the evening (UTC+1).

 

It looks like the schematic is pulling in the device from the SparkFun library, all except for the Spice model. If I try adding the Spice model directly to the device in the scematic it sometimes works for the first instance but then comes up with an error about my spice model not having a .MODEL line. I haven't worked out what that is. Maybe that's why the schematic editor desn't like the Spice model and hence is simply ignoring it.

 

Kind regards - Philip

Message 10 of 13

Hi Philip,

 

Ok so attached is a new version of your schematic with the TRIMPOT parts fixed with their appropriate SPICE models. Note that there are still other parts which are not mapped, plus you'll need at least one voltage source to supply the simulation. Currently you are using the implied power pins for your Op Amps and these are not connecting to anywhere else. You'll need to make sure you hook them up to a matching named power rail driven from a voltage source for the simulation.

 

In order to get your updated part into the schematic I did nothing more than putting the Sparkfun-resistors into my library path and then from the schematic I did Library->Update all and it updated it. It looks very much to me like it must have been updating from a different identically named file which it can see elsewhere in your library path.

 

Best Regards,

 

Rachael

Message 11 of 13

Hi Rachael -

 

Many thanks - that seems to have done it. I suspect the problem may be something to do with the fact that one of the first things I did after installing Eagle was to change all the default directories from $HOME\EAGLE to $HOME\Dev\EAGLE - I hate things that clutter your home directory. However, I then found I still had an EAGLE folder in my home directory, so I deleted it. But rather than moving my EAGLE directory I think it maybe just created a link as I then found my Dev\EAGLE had gone too! Fortunately I was able to recover it from the waste bin but maybe it created a duplicate rather than recreating the link, causing the confusion. And my POT Spice model seemes to have gone in Program Files\EAGLE. I should probably save all my files, blow EAGLE away and reinstall it.

 

I can't find a Spice model for the LM4880 but I'm not really interested in simulating that as that part of the circuit is straight out of the datasheet. I might just make a subcircuit with 100M resistors from all pins to ground, or if I'm sufficiently caffeinated I might create a basic subcircuit with a couple of opamps. The audio jacks I'll model with resistors, and maybe the input one will include my signal source, but I'm not sure about the USB socket or power pads - one or other I can make the power source.

 

When you mentioned the implied power pins for the quad opamps, the schematic just had one set for the 4 opamps - do I have to do something for the other 3 to get Spice power to them?

 

Kind regards - Philip

Message 12 of 13

Hi Philip,

 

I'm glad to hear it's working for you now 🙂

 


@philip.leriche wrote:

Hi Rachael -

 

I suspect the problem may be something to do with the fact that one of the first things I did after installing Eagle was to change all the default directories from $HOME\EAGLE to $HOME\Dev\EAGLE - I hate things that clutter your home directory. However, I then found I still had an EAGLE folder in my home directory, so I deleted it. But rather than moving my EAGLE directory I think it maybe just created a link as I then found my Dev\EAGLE had gone too!


 

It's fine to have an alternative directory setup. I had mine all configured to be working in my own specified location long before it was the default official way built into EAGLE so my configuration is also totally different to the standard setup. Just make sure all your paths are accurate and you have moved everything over, if you have duplicates it can get messy.

 


@philip.leriche wrote:

 

I can't find a Spice model for the LM4880 but I'm not really interested in simulating that as that part of the circuit is straight out of the datasheet. I might just make a subcircuit with 100M resistors from all pins to ground, or if I'm sufficiently caffeinated I might create a basic subcircuit with a couple of opamps. The audio jacks I'll model with resistors, and maybe the input one will include my signal source, but I'm not sure about the USB socket or power pads - one or other I can make the power source.


 

It seems like you have it all in hand. Anything non-critical that you can't find an obvious model for, just model it with high value resistance placed sensibly so it's effectively OC.

 


@philip.leriche wrote:

 

When you mentioned the implied power pins for the quad opamps, the schematic just had one set for the 4 opamps - do I have to do something for the other 3 to get Spice power to them?


 

I must have missed the connections on the one symbol they appear on. If they're connected up to actual power rails on one of the device parts that's fine. I didn't realise they were all gates within the one part.

 

Good luck with your simulation!

 

Best Regards,

 

Rachael

Message 13 of 13

Many thanks for the help!

(Not sure what happened to the top silk screen, and the vias linking top and bottom ground planes don't, but they're not critical. Just something to sort out on my next design.)

Img_3414a.jpg

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

Post to forums  

Autodesk Design & Make Report