-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLM3886.lib
313 lines (306 loc) · 10.5 KB
/
LM3886.lib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
* LM3886
*****************************************************************************
* (C) Copyright 2012 Texas Instruments Incorporated. All rights reserved.
*****************************************************************************
** This model is designed as an aid for customers of Texas Instruments.
** TI and its licensors and suppliers make no warranties, either expressed
** or implied, with respect to this model, including the warranties of
** merchantability or fitness for a particular purpose. The model is
** provided solely on an "as is" basis. The entire risk as to its quality
** and performance is with the customer.
*****************************************************************************
*
** Released by: WEBENCH (R) Design Center, Texas Instruments Inc.
* Date: 2012-02-28
* Edited by: Erik van Weelderen
* Email: erikvanweelderen@hotmail.nl
* Github: https://github.com/Magmoc
* Date: 2024-11-28
* Model Type: ALL IN ONE
* Simulator: PSPICE
* Simulator Version: 16.2.0.p001
* Datasheet: October 2003 (SNAS091B)
* EVM Order Number: N/A
* EVM Users Guide: N/A
* Model Version: 1.0
*
*****************************************************************************
*
* Updates:
*
* Version 1.0 :
* Release to Web
*
*****************************************************************************
* Notes:
* The LM3886 Macro Model represents the following parameters for
* split-supply operation (+/-28V):
* GBWP, input-referred voltage noise, the quiescent current,
* output swing, input offset voltage, input bias current, PSRR,
* CMRR, and the slew rate.
*
* For any convergence problems, it is suggested to set the following
* simulation options:
* VNTOL: 10u
* ABSTOL: 10n
* ITL1: 1000
* ITL2: 400
* ITL4: 400
*****************************************************************************
*$
.SUBCKT LM3886 INP INN VCC VEE GND OUT MUTE
*
* Additions by Erik van Weelderen:
* Adapted from https://forum.allaboutcircuits.com/threads/ltspice-floating-node.138032/
*
* Add pull down resistors for the following ports
* If they are not present, LTSpice gives errors.
* The errors are there because at the end of simulation,
* the sources connected to these nodes convert to high impedance.
* This leaves the nodes floating.
* However, LTSpice does not allow floating nodes to be connected
* to sources. So by adding a pull down resistor with a large value,
* this is solved.
R_PD_AV1 AV1 GND 100MEG
R_PD_OVER_CLAMP OVER_CLAMP GND 100MEG
R_PD_P0ZP1 P0ZP1 GND 100MEG
R_PD_CLAW_CLAMP CLAW_CLAMP GND 100MEG
R_PD_VSENSE VSENSE GND 100MEG
R_PD_P0Z P0Z GND 100MEG
R_PD_CL_CLAMP CL_CLAMP GND 100MEG
R_PD_UZ_N100 UZ_N100 GND 100MEG
R_PD_UZ_N102 UZ_N102 GND 100MEG
V_Vos INP2 INP_CMRR -1056uVdc
R_Rinp INP INP1 1
R_Rinn INN INN1 1
C_Cinp GND INP1 200f
C_Cinn GND INN1 200f
E_E1 VCC_BUF GND VCC GND 1
E_E2 VEE_BUF GND VEE GND 1
R_RMUTE VCC MUTE 1e6
X_UIcc VCC VEE MUTE VIMON GND INP2 INN1 HPA_PD_I
+ PARAMS: VTH=1.4I IMAX=50e-3 IMIN=0.444e-3 IIBP=210n IIBN=200n
G_G1 GND N2B INP_CMRR GND 3.2u
E_Ecmrr INN2 INN3 N2B GND 1
R_Rcmr N2B N2 1
L_Lcmr N2 GND 560nH
G_G2 GND N1B VCC_BUF VEE_BUF 1u
L_Lpsr N1 GND 2uH
R_Rpsr N1B N1 1
X_Upsrr N1B GND INN1 INN2 VCVS_LIMIT
+ PARAMS: GAIN=-1 VPOS=20M VNEG=-20M
X_Uvn INP1 INP2 vnse
*
V_V1 VCC N3 3.59Vdc
V_V4 N4 VEE 3.59Vdc
X_Ud2 INN3 N3 d_ideal
X_Ud1 INP_CMRR N3 d_ideal
X_Ud3 N4 INP_CMRR d_ideal
X_Ud4 N4 INN3 d_ideal
*
X_Ug0 INP_CMRR INN3 GND AV1 VCCS_LIMIT
+ PARAMS: GAIN=10e-6 IPOS=0.5 INEG=-0.5
X_Ug4 AV1 GND GND OVER_CLAMP VCCS_LIMIT
+ PARAMS: GAIN=26.5u IPOS=111u INEG=-108.1u
GRU1 GND AV1 VALUE={-V(AV1)/1e6}
GRU2 GND OVER_CLAMP VALUE={V(OVER_CLAMP)/2.1e9}
C_Cc1 GND OVER_CLAMP 5.3p
C_Cc2 P0ZP1 GND 5e-15
C_Cc3 CLAW_CLAMP GND 995f
*
X_UIout VCC VEE VIMON GND TRAN_IOUT
G_G3 GND VSENSE OVER_CLAMP GND 1u
G_G4 GND P0Z VSENSE GND 1u
G_G5 GND P0ZP1 P0Z GND 1u
G_G6 GND CLAW_CLAMP P0ZP1 GND 1m
G_G7 GND CL_CLAMP CLAW_CLAMP GND 1m
GRU3 VSENSE GND VALUE={V(VSENSE)/1e6}
GRU5 GND P0Z VALUE={-V(P0Z)/1e6}
GRU6 P0ZP1 GND VALUE={V(P0ZP1)/1e6}
GRU7 CLAW_CLAMP GND VALUE={V(CLAW_CLAMP)/1e3}
GRU8 CL_CLAMP GND VALUE={V(CL_CLAMP) /1e3}
*
X_UpwrDn CL_CLAMP GND MUTE N90 GND VCC VEE HPA_PD_SGNL
*X_Uthd N90 GND VCLP G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2 1 2 1G
.MODEL _Uz_S2 VSWITCH Roff=10e6 Ron=1.0 Voff=0.1V Von=-0.1V
.ends Zout_Uz_S2
*$
.subckt Zout_Uz_H1 1 2 3 4
H_Uz_H1 3 4 VH_Uz_H1 1e3
VH_Uz_H1 1 2 0V
.ends Zout_Uz_H1
*
*$
.subckt rnoiseless a b PARAMS: R=1k
*H_H1 c b VH_H1 {R}
*VH_H1 a c 0
ERES a 3 VALUE = { I(VSENSE) * R }
Rdummy 30 3 1
VSENSE 30 b DC 0V
.ends
*$
*
.SUBCKT EPOLY1 1 2 3 4 PARAMS: Coeff1=0.0 Coeff2=0.0
*For distortion purpose
*EINT 3 4 POLY(1) (1,2) (0 1 Coeff1 Coeff2)
EINT 3 4 POLY(1) (1,2) (0 1 0 0)
.ENDS EPOLY1
*$
*
.subckt D_ideal A C
D1 A C DNOM
* Adaptation from Erik van Weelderen:
* Change N=1e-3 to N=1e-1.
* LTSpice gave an error about limiting the value to 1e-1,
* So just change it to that value instead.
.MODEL DNOM D (IS=1e-16 RS=1e-3 N=1e-1)
.ENDS D_ideal
*
*$
.subckt VCCS_Limit VCP VCN IOUTP IOUTN PARAMS: Gain = 1.7e-3
+ Ipos = 0.100 Ineg = -0.165
G1 IOUTP IOUTN VALUE={LIMIT(Gain*V(VCP,VCN),Ipos,Ineg)}
.ends VCCS_Limit
*
*$
.subckt VCVS_Limit VCP VCN VOUTP VOUTN PARAMS: Gain = -1
+ Vpos = 20m Vneg = -20m
E1 VOUTP VOUTN VALUE={LIMIT(Gain*V(VCP,VCN),Vpos,Vneg)}
.ends VCVS_Limit
*$
*
.SUBCKT VNSE 1 2
**************************
* BEGIN SETUP OF NOISE GEN - NANOVOLT/RT-HZ
* INPUT THREE VARIABLES
* NLF - NV/RHZ AT (1/F) FREQ
* FLW - FREQ FOR (1/F) VAL
* NVR - NV/RHZ FLATBAND
**************************
* START CALC VALS
.PARAM NLF=20.2
.PARAM FLW=1
.PARAM NVR=1.99
.PARAM GLF={PWR(FLW,0.25)*NLF/1164}
.PARAM RNV={1.184*PWR(NVR,2)}
.MODEL DVN D KF={PWR(FLW,0.5)/1E11} IS=1.0E-16
* END CALC VALS
I1 0 7 10E-3
I2 0 8 10E-3
D1 7 0 DVN
D2 8 0 DVN
E1 3 6 7 8 {GLF}
R1 3 0 1E9
R2 3 0 1E9
GR3 3 6 3 6 1E-9
E2 6 4 5 0 10
R4 5 0 {RNV}
R5 5 0 {RNV}
R6 3 4 1E9
R7 4 0 1E9
E3 1 2 3 4 1
C1 1 0 1E-15
C2 2 0 1E-15
C3 1 2 1E-15
.ENDS VNSE
*$
*
.SUBCKT HPA_PD_I VCC VEE PD Vimon AGND Ninp Ninn PARAMS: Vth = 1.4 Imax = 1e-3 Imin = 3n
+ IIBP= 0.55u IIBN= 0.56u
*GBIAS VCC VEE VALUE = {IF(V(PD) >= (V(VEE)+Vth),Imax,Imin)}
GBIAS VCC VEE VALUE = {IF(V(PD) >= V(VCC),Imax,Imin)}
Ebuf VDD 0 VCC 0 1
Ginp VDD Ninp VALUE = {IF(V(PD) >= V(VCC),IIBP,0)}
Ginn VDD Ninn VALUE = {IF(V(PD) >= V(VCC),IIBN,0)}
.ENDS
*$
*
.SUBCKT HPA_PD_Sgnl CP CN DIS VP VN VCC VEE PARAMS: GAIN = 1
EVCVS VP VN VALUE = {IF(V(DIS,VEE) >= 1.4,V(CP,CN)*GAIN,0)}
.ENDS HPA_PD_Sgnl
*$
*
.SUBCKT Tran_Iout VCC VEE VIMON AGND
X_Siq1 N1 GND_FLOAT VIMON N2 Amp_Dyn_Iout_Siq1
X_Siq2 N1 GND_FLOAT VIMON N3 Amp_Dyn_Iout_Siq2
C_Ciq1 N1 GND_FLOAT 10e-12 TC=0,0
R_Riq1 N1 VIMON 10 TC=0,0
R_Riq2 N2 GND_FLOAT 10e3 TC=0,0
R_Riq3 GND_FLOAT N3 10e3 TC=0,0
G_Gsourcing VCC GND_FLOAT N3 GND_FLOAT 0.001
G_Gsinking VEE GND_FLOAT N2 GND_FLOAT 0.001
.ENDS Tran_Iout
*$
.subckt Amp_Dyn_Iout_Siq1 1 2 3 4
S_Siq1 3 4 1 2 _Siq1
RS_Siq1 1 2 1G
.MODEL _Siq1 VSWITCH Roff=1e6 Ron=1.0 Voff=0.0V Von=-0.10V
.ends Amp_Dyn_Iout_Siq1
*$
*
.subckt Amp_Dyn_Iout_Siq2 1 2 3 4
S_Siq2 3 4 1 2 _Siq2
RS_Siq2 1 2 1G
.MODEL _Siq2 VSWITCH Roff=1e6 Ron=1.0 Voff=0.0V Von=0.10V
.ends Amp_Dyn_Iout_Siq2
*$
*
.SUBCKT VCLAMP_W_SENSE_0 VCC VEE VI VO VIMON GNDF
+ PARAMS: VMAXIO = 0.1 VMINIO = 0.1 SLOPE = 0
EPCLIP VCC_CLP 0 VALUE = {V(VCC,GNDF) - SLOPE*V(VIMON,GNDF) - VMAXIO}
ENCLIP VEE_CLP 0 VALUE = {V(VEE,GNDF) - SLOPE*V(VIMON,GNDF) + VMINIO}
ECLAMP VO GNDF VALUE = {LIMIT(V(VI,GNDF), V(VCC_CLP), V(VEE_CLP))}
.ENDS
*
*$
.SUBCKT RNOISE_LESS_WILIM_0 P N PARAMS: RX = 1E-3 IMAX = 1M IMIN = -1M
GRES P N VALUE = {LIMIT(V(P,N)/RX, IMAX, IMIN)}
.ENDS
*
*$
.SUBCKT AMETER_0 VI VO VIMON GNDF
+ PARAMS: GAIN = 1
VSENSE VI VO1 DC = 0
R1 VO1 VO 1e-3
R2 VO1 VO 1e-3
R3 VO1 VO 1e-3
R4 VO1 VO 1e-3
EMETER VIMON GNDF VALUE = {I(VSENSE)*GAIN}
.ENDS
*
*$