From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multisim and Ultiboard

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make generic spice models work in multisim?

Solved!
Go to solution

I have an external Spice model I need to use on occasion.  I alsways have trouble with this.  It doesn't seem to be because I don't understand the models or know how spice works, but more that the conventions to define and get nodes hooked up correctly and various other aspects of MS are ambiguous to me.

 

Here is an NTC thermistor model and a multisim schematic I'm working on.  I've tried a lot of things but haven't got the errors to go away.  I've put it back the way I first started here.

 

This model is from:

http://www.ecircuitcenter.com/Circuits/therm_model1/therm_model1.htm

 

Can anyone explain how to get this NTC thermistor model to work in MS?

 

The 100V ramp at 1V/sec source is the temperature input to the model.  (0-100C, 1 degC/sec on the grapher if I ever get that far)

 

Thanks,

David B

Download All
0 Kudos
Message 1 of 13
(12,622 Views)
Solution
Accepted by topic author dbur

Hi David,

 

I think you pasted the entire netlist given on the webpage into Multisim's component wizard. I think this is the root of the problem. Really, all you need to enter into the Component Wizard are the following lines:

 

.SUBCKT NTC_10K_1   1  2  4  5
ETHERM 1 3 VALUE = { I(VSENSE)*10K*EXP( 3548/(V(4,5)+273) - 3548/(25+273) ) }
VSENSE 3 2 DC 0
.ENDS

 

The remaining lines that are given to you generate the stimulus, like the voltage source that you placed in your schematic.

 

I corrected this and attached the corrected circuit. Open this in Multisim and click Simulate>>Analyses>>DC Sweep and click Simulate. You should see the IV curve of the NTC resistor operating at different temperatures.

 

Hope that helps.

----------
Yi
Software Developer
National Instruments - Electronics Workbench Group
0 Kudos
Message 2 of 13
(12,598 Views)

Hi David,

 

It looks like the SPICE file that that web page provides is for a test/demo circuit using the thermistor model. The component you're making in Multisim needs  a single .MODEL or .SUBCKT, so you just need to remove the extra stuff from the model you're using in the thermistor.


In this case, you only need the four line NTC_10K_1 subcircuit. Everything else you see in the provided .cir is connected to the thermistor or an instance of the thermistor, not part of the thermistor model.

Christopher Lansing
Software Developer
National Instruments
0 Kudos
Message 3 of 13
(12,597 Views)

Dang, I should have looked closer.  I was hung up on thinking I had node matching issues between MS and the model.

 

Thanks.

0 Kudos
Message 4 of 13
(12,576 Views)
I have some questions regarding Multisim and this implementation of a Thermistor.

If I load the NTC_10k_1.ms10 attachment into Multisim and I want to copy the component to another circuit, Is it possible even though I did not create the original component?

The Thermistor I'm using only has 2 pins. So I'm trying to adapt this model to work in my case.
In order to simulate a Thermistor in Multisim there's the physical resistance and there's the environment (temp.). So doesn't there need to be a virtual parameter to control the temperature during the simulation? If so, how would this be implemented in the model. Would I need to use a Model Maker for this?

Thanks in advance.
Message Edited by Speedyg8 on 01-07-2010 03:41 PM
0 Kudos
Message 5 of 13
(12,051 Views)

Hi Speedyg8,

 

You can copy the component from MTC_10k_1.ms10 into another design and use it there. It will continue to work.

 

 

The thermistor in the example posted earlier actually only has two pins. The additional pins are added to the model to provide a convenient way to specify the input temperature. (The difference in voltage between Ra and Rb is the temperature in Celsius.) If you want to create a thermistor component with only 2 inputs, you will need another way to specify the temperature, and you have a couple of options. (I'm assuming here that you want the temperature to be constant with respect to time. If you need it to vary with time, you will need a slightly different approach.)

 

 

1. You could create a SPICE model that uses an instance parameter to specify the temperature. In this case, you will create a model where you can easily override the temperature. Your model will look something like:


.SUBCKT THERMISTOR 1 2 PARAMS:TEMPVAL=273

R1 1 2 {TEMPVAL} #Substitute with the actual function you want to use

.ENDS

TEMPVAL then becomes a parameter that you can use in your model. When you place the component, you can double click on the component, click Edit Model, and you will see a Current Instance Parameters. You can specify the instance temperature by typing PARAMS: TEMPVAL=300. The advantage of this approach is if you have multiple thermistors, you can independently set the temperature.

 

2. You could create a SPICE model that uses a globally defined parameter to specify the temperature. You model will look something like:

 

.SUBCKT THERMISTOR 1 2

R1 1 2 {TEMPVAL} #Substitute with the actual function you want to use

.ENDS

 

TEMPVAL  then becomes a parameter than you must specify outside of the component. The easiest way to do this is to place an Arbitrary SPICE Block, (located in Basic > BASIC_VIRTUAL > ARBITRARY_SPICE_BLOCK), and set the global variable there.

 

.PARAM TEMPVAL = 273

 

3. There is a third option, to use the global, specified in the Analysis Options. I mention this only for completeness, but you might consider this approach if the other components in your design will be at the measured temperature.

 

I'll give you one final tip. The model in the posts above uses sources to emulate the resistive behaviour, whereas in my examples, I've used resistors directly. Multisim can use equations (identified by the curly braces) to specify the resistance, so you don't need to use sources to get the desired behaviour.

Garret
Senior Software Developer
National Instruments
Circuit Design Community and Blog

If someone helped you, let them know. Mark as solved or give a kudo. 🙂
Message 6 of 13
(12,023 Views)

You can also right click on the part and add it to your library from right out of the schematic.

David B

Message 7 of 13
(11,999 Views)

>The easiest way to do this is to place an Arbitrary SPICE Block, (located in Basic > BASIC_VIRTUAL > ARBITRARY_SPICE_BLOCK), and set the global variable there.

 

In Multisim 10.1 Pro, I could not locate "Basic > BASIC_VIRTUAL > ARBITRARY_SPICE_BLOCK" could this have changed recently? There is not reference to it in Help either.

 

 

0 Kudos
Message 8 of 13
(11,937 Views)

Have a look again. I checked all Professional versions of Multisim and it was there.

 

PlaceComponentAribrarySPICEBlock.png

 

In the component reference, it is topic Basic Components > Arbitrary SPICE Block.

Garret
Senior Software Developer
National Instruments
Circuit Design Community and Blog

If someone helped you, let them know. Mark as solved or give a kudo. 🙂
Message 9 of 13
(11,934 Views)

My version doesn't have it. I guess I'll have to see about upgrading our support subscription.

Anyway, thanks for your help.

0 Kudos
Message 10 of 13
(11,907 Views)