Post by w***@dialup4less.comCould someone verify for me that the AD8218 spice model is screwed up? The model and data sheet are here
http://www.analog.com/en/specialty-amplifiers/current-sense-amplifiers/ad8218/products/product.html
I'm just trying to reproduce Figure 35 in the datasheet. I'm using the circuit in Figure 34. I tied Vs and ENB to +IN because Ltspice doesn't like those pins floating. I set the shunt resistor to 0.02 ohms, the battery voltage to 24V, the reference to 1.25v and vary the Load from -5Amps to 5Amps in 0.05amp increments. My results show the part offsetting by twice the reference voltage instead of the reference voltage. I can reproduce the graph with the 1.25V reference but the datasheet shows a 2.5v reference. Here is the spice netlist.
* C:\Projects\LIT\N48_TEC_Driver\simulation\AD8218Test.asc
XU1 Vpos Vneg Vpos Vref Vpos 0 Vout AD8218
V3 Vpos 0 24
R2 Vneg Vpos 0.02
V1 Vref 0 1.25
I1 N001 0 1
R1 Vneg N001 100
.include AD8218.cir
.dc I1 -5 5 0.05
.backanno
.end
Thanks
I received the new AD8218.cir file. I haven't tried it yet. It should be on the ADI website within the next week or so.
* AD8218 SPICE Macro-model
* Description: Current Shunt Monitor, high side current sensing
* Generic Desc: 4.0V to 80V operation, 8S6DPTMRNJIX
* Developed by: DK
* Revision History:
* 1.0 (9/2012) - DK - initial release
* 2.0 (8/2013) - PB - modified gain of voltages on VREF to output from 2x to 1x
* Copyright 2012 by Analog Devices, Inc.
*
* Refer to http://www.analog.com/Analog_Root/static/techSupport/designTools/spiceModels/license/spice_general.html
* for License Statement. Use of this model indicates your acceptance
* of the terms and provisions in the License Statement.
*
*
* Not Modeled:
* Temperature effects
* PSRR vs Frequency
*
* Parameters modeled include:
* CMRR vs Frequency
* VOS (RTI)
* Bandwidth
* Gain Error
* Voltage Spectral Noise: 110nV/rt hz at 1kHz
* Output Impedance: 2 ohms
* Slew Rate
* Common Mode Range: 4.0V to 80V
*
* END Notes
* Maximum output voltage limited to 5.2V
*
* Node Assignments
* noninverting input
* | inverting input
* | | Vs
* | | | ref
* | | | | enable
* | | | | | ground
* | | | | | | output
.SUBCKT AD8218 +IN -IN VS REF ENB GND OUT
*** Input Stage ***
EV 99 0 Value={ IF( V(VS) <4, V(+IN) , IF( V(VS) > 5.5, V(+IN), V(VS) )) }
Q1 3 1 7. 0 NPN
Q2 4 2 8 0 NPN
R1 99 3 1129
R2 99 4 1129
R3 7. 9 1e3
R4 8 9 1e3
I1 9 GND 400E-6
Ibp +IN GND 124E-6
Ibn -IN GND 124E-6
*** Input and Feedback Resistors ***
EOS 5 1 poly(1) (201,GND) 0 -1
R9 5 +IN 75e3
R10 REF 5 1.5e6
R11 -IN 2 75.045e3
R12 20 2 1.5e6
*** 1st Stage ***
D1 100 6 DZENER2
G1 100 10 1 2 .001
D2 10 6 DZENER1
R8 10 100 200e3
*** 2nd Stage ***
G2 100 20 10 100 .005
R7 20 100 1E6
C1 20 100 11.68E-9
*** Internal Reference ***
E1 100 0 7 0 1
R5 99 7 100e3
R6 7 GND 100e3
**** zero-pole stage
*G4 100 30 20 100 .59e-6
G4 100 30 20 100 .588e-6
R14 30 35 1e6
R16 35 100 1.7e6
L1 30 35 .65
**** 1st pole stage
G3 100 40 30 100 1e-6
R13 40 100 1E6
C2 40 100 186e-15
**** 2nd pole stage
G5 100 45 40 100 1e-6
R15 45 100 1E6
C3 45 100 186e-15
*C3 45 100 1e-15
*** Spectral Noise ***
VN GND 190 .65
DN 190 200 DNOISE
RN 200 GND 1
VM GND 200 0
FN GND 201 VM 1
RZ 201 GND 1
*** CMRR ***
*GCMR 500 0 505 0 .3e-9
*RCMR 500 501 1e6
*LCMR 501 0 80
GCMR 500 0 505 0 .3e-9
RCM1 500 501 549e6
LCMR 500 501 80
RCM2 501 0 1e6
GCM2 600 0 500 0 .85e-6
RCM3 600 0 1e6
CCM2 600 0 655e-15
RCMR1 +IN 505 10e6
RCMR2 505 -IN 10e6
*** Clamp
*D3 11 20 Dlow
D3 11 20 D
V7 11 0 0
D4 20 12 D
V8 +IN 12 .722
*** Output Stage ***
EAVG AVG GND Value={ ((V(+IN) + V(-IN))*0.5 )}
E02 65 0 Value={ IF( V(AVG) > 80, 5.2 , IF( V(AVG) < 4.0, 0, V(45))) }
E03 70 0 Value={ IF( V(ENB) == 0, V(65) + V(600) + .08, IF( V(ENB) != 0, V(65) + V(600), V(65) + V(600) )) }
E04 75 0 Value={ IF( V(70) > 5.2, 5.2 , IF( V(70) < 5.2, V(70)-.00491, V(70) )) }
*** Output Resistance
*Rout 70 OUT 2
Rout 75 OUT 2
*** Output Current limiting
Et 71 0 70 OUT 20
Qc 45 71 72 0 NPN
Re 72 0 10
.model D D
*.model Dlow D(Rdon=0 Rdoff=1e6 Vfwd=0.7)
*.model Dlow D(Ron=0 Roff=1e6 Vf=0.7)
.MODEL DZENER1 D(BV=2V, IS=1E-14, IBV=1E-3)
.MODEL DZENER2 D(BV=2V, IS=1E-14, IBV=1E-3)
.MODEL DNOISE D(AF=0, KF=0.0195e-10.5)
.model DILIM D(IS=1E-15)
.model NPN NPN
.end