本帖最后由 xutang 于 2023-4-17 23:01 编辑
#申请原创# 首先我们要构建一个放大倍数等于1的东西,输入等于多少输出等于多少。在LTspice help 如图1所示。选择LTspice Simulator 图1:LTspicehelp 图2:LTspiceSimulator 在图2里面选择 Circuit Elements,他会给你展示一些基本的元件,这基本都是SPICE通用的,有些可能不是通用的,建议去看下标准的SPICE支持哪些开头的,在这里我们选择电压敏感电压源(voltage dependent voltage),他的描述如下所示。 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.
|
大概就是n+和n-的输出来自nc+和nc-的输入电压✖️上gain。大概选定元件以后可以使用subckt构建一个子电路模块,在LTspice中他给出了例子,如下所示 .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.
|
大概意思就是*是注释,在.subckt后面跟随的divider是模块的名称,n1 n2 n3是引出的网络节点名称。根据以上信息咱们就可以构建一个gain=1的子电路模块。 例1:放大倍数=1的subcircuit *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
|
图3:例1仿真结果 非常基本的功能 |