2208 views|7 replies

2625

Posts

6

Resources
The OP
 

LTspice (14) Building the IND901 model (1) [Copy link]

First we need to build something that has an amplification factor of 1, and the output is equal to the input. In the LTspice help, as shown in Figure 1. Select LTspice Simulator

Figure 1: LTspice help

Figure 2: LTspice Simulator

Select Circuit Elements in Figure 2, and it will show you some basic components. These are basically common to SPICE, but some may not be common. It is recommended to see which beginnings the standard SPICE supports. Here we select voltage dependent voltage, and its description is shown below.

E. Voltage Dependent Voltage Source


Symbol Names: E, E2
There are three types of voltage-dependent voltage-source circuit elements.
Syntax: Exxx n+ n- nc+ nc- <gain>
This circuit element asserts an output voltage between the nodes n+ and n- that depends on the input voltage between nodes nc+ and nc-. This is a linearly dependent source specified solely by a constant gain.
Syntax: Exxx n+ n- nc+ nc- table=(<value pair>, <value pair>, ...)
A look-up table is used to specify the transfer function. The table is a list of pairs of numbers. The second value of the pair is the output voltage when the control voltage is equal to the first value of that pair. The output is linearly interpolated when the control voltage is between specified points. If the control voltage is beyond the range of the look-up table, the output voltage is extrapolated as a constant voltage of the last point of the look-up table.
Syntax: Exxx n+ n- nc+ nc- Laplace=<func(s)>
+ [window=<time>] [nfft=<number>] [mtol=<number>]
The transfer function of this circuit element is specified by its Laplace transform. The Laplace transform must be a function of s. The frequency response at frequency f is found by substituting s with sqrt(-1)*2*pi*f. The time domain behavior is found from the impulse response found from the Fourier transform of the frequency domain response. LTspice must guess an appropriate frequency range and resolution. The response must drop at high frequencies or an error is reported. It is recommended that LTspice first be allowed to make a guess at this and then check the accuracy by reducing reltol or explicitly setting nfft and the window. The reciprocal of the value of the window is the frequency resolution. The value of nfft times this resolution is the highest frequency considered. The Boolean XOR operator, "^" is understood to mean exponentiation "**" when used in a Laplace expression.
Syntax: Exxx n+ n- value={<expression>}
This is an alternative syntax of the behavioral source, arbitrary behavioral voltage source, B.
Syntax: Exxx n+ n- POLY(<N>) <(node1+,node1-) (node2+,node2-)+ ... (nodeN+,nodeN-)> <c0 c1 c2 c3 c4 ...>
This is an archaic means of arbitrary behavioral modeling with a polynomial. It is useful for running legacy opamp models.
Note: It is better to use a G source shunted with a resistance to approximate an E source than to use an E source. A voltage controlled current source shunted with a resistance will compute faster and cause fewer convergence problems than a voltage controlled voltage source. Also, the resultant nonzero output impedance is more representative of a practical circuit.

The output of n+ and n- comes from the input voltage of nc+ and nc-. After selecting the components, you can use subckt to build a subcircuit module. In LTspice, he gave an example as shown below

.SUBCKT -- Define a Subcircuit


As an aid to defining a circuit, repetitive circuitry can be enclosed in a subcircuit definition and used as multiple instances in the same circuit. Before the simulation runs, the circuit is expanded to a flat netlist by replacing each invocation of a subcircuit with the circuit elements in the subcircuit definition. There is no limit on the size or complexity of subcircuits.
The end of a subcircuit definition must be a .ends directive.
Here is an example using a subcircuit:
*
* This is the circuit definition
X1 a b 0 divider
V1 a 0 pulse(0 1 0 .5μ .5μ 0 1μ)
* this is the definition of the subcircuit
.subckt divider n1 n2 n3
r1 n1 n2 1k
r2 n2 n3 1k
.ends
.tran 3
.end
Which runs after expanding to
* Expand X1 into two resistor network
r:1:1 a b 1k
r:1:2 b 0 1k
*
v1 a 0 pulse(0 1 0 .5μ .5μ 0 1μ)
.tran 3μ
.end
Note that unique names based on the subcircuit name and the subcircuit definition element names are made for the circuit elements inserted by subcircuit expansion.

The general meaning is that * is a comment, the divider following .subckt is the name of the module, and n1 n2 n3 are the names of the derived network nodes. Based on the above information, we can build a subcircuit module with gain=1.

Example 1: Sub circuit with amplification factor = 1

*this is IND901 spice model
* Device name
* | OPA IN-
* | | OPA IN+
* | | | OPA OUT
* | | | |
.subckt IND901 IN- IN+ OUT REF+ REF-
E1 REF+ OUT IN+ IN- 1
.ends

Figure 3: Simulation results of Example 1

Very basic function , let's add Gain Error to it. Here we can directly use the param command to define a Gain Error

Example 2: Op amp with Gain Error

*this is circuit define
.param GainError=0.2/100
.param Gain=1*(1+GainError)
*this is IND901 spice model
* Device name
* | OPA IN-
* | | OPA IN+
* | | | OPA OUT
* | | | |
.subckt IND901 IN- IN+ OUT REF+ REF-
E1 REF+ OUT IN+ IN- {Gain}
.ends

Figure 4: Simulation results of Example 2

Next we can add a little offset, which can be done using an independent voltage source.

Example 3: Op amp with offset

*this is circuit define
.param GainError=0.2/100
.param Gain=1*(1+GainError)
.param Vos=0.03
*this is IND901 spice model
* Device name
* | OPA IN-
* | | OPA IN+
* | | | OPA OUT
* | | | |
.subckt IND901 IN- IN+ OUT REF+ REF-
E1 IN_REF+ IN_OUT IN+ IN- {Gain}
E2 OUT REF+ Value={V(IN_OUT,IN_REF+)+Vos}
.ends

Figure 5: Simulation results of Example 3

Simulation model, not perfect

IND901.sub (370 Bytes, downloads: 0)

List of LTspice simulation tutorials

https://en.eeworld.com/bbs/thread-1211610-1-1.html

That’s all for today, bye~

This post is from Analog electronics

Latest reply

If Chinese characters are garbled, it will definitely be unusable. There are many things in English that I can't understand. It's really difficult.   Details Published on 2023-4-18 23:03
Personal signature

希望做一些大家觉得好用的东西!


2w

Posts

341

Resources
2
 

The standard SPICE description language of the simulation library is a bit difficult to understand in English. If you are not good at English, you will not be able to use their library.

This post is from Analog electronics

Comments

It's OK. There are so many translation software and the English of simulation software is relatively simple. I only got 16 points in English. I just read it every day at work and I can basically learn it.  Details Published on 2023-4-18 12:47
 
 

2625

Posts

6

Resources
3
 
qwqwqw2088 posted on 2023-4-18 10:30 The standard SPICE description language of the simulation library is a bit difficult to understand in English. If you are not good at English, you will not be able to use their library.

It's OK. There are so many translation software.



The English of the simulation software is also relatively simple


I only got 16 points in English. I learned it by doing it every day at work.


This post is from Analog electronics
 
 
 
 

2625

Posts

6

Resources
4
 
IND901.pdf (626.95 KB, downloads: 1)

IND901 Manual

This post is from Analog electronics

Comments

This kind of offset model may not work if written in Chinese. There is also a param command to define a gain error, etc. It is definitely not executable if written in the simulation library at noon. I found that I did not try it in Chinese.   Details Published on 2023-4-18 14:26
 
Personal signature

希望做一些大家觉得好用的东西!

 
 
 

2w

Posts

341

Resources
5
 

This offset model may not work if written in Chinese.

There is also a param command to define a Gain Error, etc.

The simulation library written in noon will definitely not be executed

I found no useful Chinese attempts.

This post is from Analog electronics

Comments

The Chinese interpreter is not supported, and there will be garbled characters when using vscode for the first time without setting gb2325  Details Published on 2023-4-18 14:43
 
 
 
 

2625

Posts

6

Resources
6
 
qwqwqw2088 posted on 2023-4-18 14:26 This offset model may not work if written in Chinese. There is also a param command to define a Gain Error, etc. Use noon to write a simulation library...

The Chinese interpreter is not supported, and there will be garbled characters when using vscode for the first time without setting gb2325

This post is from Analog electronics
 
Personal signature

希望做一些大家觉得好用的东西!

 
 
 

4817

Posts

4

Resources
7
 

If Chinese characters are garbled, it will definitely be unusable. There are many things in English that I can't understand. It's really difficult.

This post is from Analog electronics

Comments

If you watch more, you will understand. If you want to do it, you can do it.  Details Published on 2023-4-19 08:07
 
 
 
 

2625

Posts

6

Resources
8
 
led2015 published on 2023-4-18 23:03 If Chinese has garbled characters, it will definitely be unusable. There are many things in English that I can't understand. It's really difficult

If you watch more, you will understand. If you want to do it, you can do it.


This post is from Analog electronics
 
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list