Trying to add a Diodes Inc regulator to Spice - help

Thread Starter

Wolframore

Joined Jan 21, 2019
2,619
I'm trying to add to spice, not sure what I'm doing... wrong... lol

created the asy:
1580319341633.png

1580319222856.png
1580319466410.png


*DIODES-BCD AP2127 ADJ Version Spice Model v1.0
*
*NOTE: This is a simplified model not all features are modeled.
*
.subckt AP2127_ADJ 1 2 3 4 5
* NODES: VIN GND EN ADJ VOUT
M1 5 9 1 1 MOD1 L=1u W=1000u
R1 6 1 1E6
C1 9 1 20E-12
C2 5 9 20E-12
G1 2 20 4 12 6E-6
G2 2 22 12 4 6E-6
F1 22 2 VS 1
F2 1 6 VS 20
G3 6 1 22 2 100E-6
R3 20 23 10E3
VS 23 2 0
C3 20 2 310E-15
C4 20 5 10E-12
R2 22 2 5E6
R5 22 24 400E3
C5 24 2 20E-12
D1 5 1 Dmod1
R6 3 13 20E4
R7 3 2 3E6
C6 13 2 4E-6
R8 1 5 50E6
R9 6 9 20E3
R10 2 12 Rmod1 1
R40 5 2 5E4
S1 1 6 13 2 Smod1
I1 2 12 0.8
.MODEL MOD1 PMOS (VTO=-0.82 RS=0.2 RD=0.2 IS=1E-15 KP=0.73 KF=2e-19 AF=1.22)
.MODEL Dmod1 D (IS=1E-13 RS=0.5 N=1)
.MODEL Dmod2 D (IS=1E-13 RS=0.1 N=0.5)
.MODEL Rmod1 RES (TC1=-3E-5 TC2=-1E-7)
.MODEL Smod1 VSWITCH RON=1E-3 ROFF=10E6 VON=0.5 VOFF=1.2
.ENDS AP2127_ADJ
*
 

Alec_t

Joined Sep 17, 2013
15,132
In the Symbol Attribute editor, try :-
Prefix: X
SpiceModel: AP2127_ADJ
Value: AP2127_ADJ
ModelFile: AP2127_ADJ.sub

Save the asy and sub files where Spice expects to find them.
 

Alec_t

Joined Sep 17, 2013
15,132
Good, but setting the attribute 'ModelFile: AP2127_ADJ.sub' should avoid having to add an include command each time you use the model. You don't need the '.sub' bit in the SpiceModel attribute.
Value2 can be blank.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,619
I tried adding TL071, LM358 and a few other jellybean opamps and still having issues, I'm sure I've missed something. The regulator is working perfectly now. I need a 0-5V (DC) opamp to boost a 200 mV signal up to 1V for better ADC resolution.
 

Alec_t

Joined Sep 17, 2013
15,132
I've had problems with the LM358 model in my collection. If the schematic has only one instance the model works, but with more than one instance the sim grinds to a halt. I'll get round to finding a better model eventually :). In the meantime I just use the LT1006 model when a second instance is needed.
 

Bordodynov

Joined May 20, 2015
3,429
In my collection of models there are several models of this chip (5 pcs.), including the model on transistors. In one of my circuits I put 4 pcs (with my model) and everything worked. Also I have a model of the latest, low voltage version of this chip - LM358LV.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
2,619
I’m so close to finishing my design... I decided to go a different route and will us a TI INA266 for I2C current sense amplifier instead. It has 16 bit resolution and should be A better solution. I won’t be able to model that unfortunately.
 
Top