Spice model for PAM2423

Hi Folks,

I got some boards made using a PAM2423AECADJR, I laid out schematic and board based off the sample design, but when the fully assembled boards arrived, they do not work. :frowning:

So I’m now trying to simulate the schematic. I searched Diode’s website, but no spice models exist for the chip I used.

So I think I’m going to have to make my own, I got help from ChatGPT, and this is what I came up with:

* SPICE Model for PAM2423AECADJR
.SUBCKT PAM2423AECADJR IN OUT FB SS COMP EN GND
* IN   - Input voltage
* OUT  - Output voltage
* FB   - Feedback pin
* SS   - Soft-start pin
* COMP - Compensation pin
* EN   - Enable pin
* GND  - Ground

* INPUT VOLTAGE REGULATION
VUVLO UVLO GND DC 2.5          ; Under-voltage lockout threshold

* SOFT-START CIRCUIT 		   ; Soft-Start Pin Bias Current Vss = 1.2V
I_SS SS GND 4.5uA              ; Soft-start current source
C_SS SS GND 10nF               ; External soft-start capacitor (adjustable)

* PWM OSCILLATOR
VOSC OSC GND SIN(0 1 520k)     ; 520 kHz oscillator
R_OSC OSC GND 1MEG             ; Oscillator equivalent resistance

* ERROR AMPLIFIER
EERR COMP GND (OUT FB) 1.262   ; Error amplifier for feedback regulation
RERR COMP GND 1MEG             ; High resistance at COMP pin

* POWER STAGE (PMOS TRANSISTOR)
M1 SW IN GND GND PMOS_MODEL    ; depletion mode N-channel switching transistor, should be NMOS ? no PCHAN parameter.
.MODEL PMOS_MODEL PMOS(VTO=-1 KP=0.5) ; Zero-bias threshold voltage (VTO) + Transconductance parameter (KP)

* INDUCTOR
L1 SW OUT 6.8uH                ; Per example 

* RECTIFIER DIODE
D1 OUT SW SCHOTTKY_MODEL       ; Schottky diode
.MODEL SCHOTTKY_MODEL D(IS=1e-15 N=1.2)

* OUTPUT CAPACITOR WITH ESR MODELED EXPLICITLY
COUT OUT Midpoint 100uF       ; Output capacitor
R_ESR Midpoint GND 0.05       ; ESR modeled as separate resistor

* OVERVOLTAGE PROTECTION
V_OVP_REF OVP_REF GND DC 1.4513   ; OVP threshold at 115% of FB
E_OVP_CTRL OVP_CTRL GND VALUE { V(FB) - V(OVP_REF) } ; Comparator output
S_OVP OVP GND OVP_CTRL GND VSWITCH_MODEL
.MODEL VSWITCH_MODEL SW(RON=0.01 ROFF=1MEG)  ; Removed  VON=0.001 VOFF=0 as it was ignored anyway

* ENABLE PIN (EN)
R_EN EN GND 1MEG              ; Pull-down for EN pin
V_EN ENABLE GND DC 1.4        ; Logic high threshold for enable 1.4V Logic low 0.4V

.ENDS PAM2423AECADJR

As its a DC-DC converter, the mosfet is built-in and the datasheet does not provide much detail on exactly how it works.

When I try to load this up in the simulator (KiCad 8.0.7 + ngspice 43) and run an OP simulation, I get a bunch of warnings, and the calculation is not what I expect:

Note: Codel model file loading path is C:\Users\Username\IdeaProjects\personal\ProjectName\
Note: Compatibility modes selected: ps a
Circuit: KiCad schematic
Doing analysis at TEMP = 27.000000 and TNOM = 27.000000
Using SPARSE 1.3 as Direct Linear Solver
Warning: singular matrix:  check node probe_int_net-_u2-comp__c6_1
Note: Starting dynamic gmin stepping
Warning: singular matrix:  check node xu2:probe_int_comp#branch
Warning: singular matrix:  check node xu2:probe_int_comp#branch
Warning: singular matrix:  check node xu2:probe_int_comp#branch
Warning: singular matrix:  check node xu2:probe_int_comp#branch
Warning: singular matrix:  check node xu2:probe_int_comp#branch
Warning: Dynamic gmin stepping failed
Note: Starting true gmin stepping
Warning: True gmin stepping failed
Note: Starting source stepping
Warning: source stepping failed
Note: Transient op started
Error: Transient op failed, timestep too small
Error: The operating point could not be simulated successfully.
Any of the following steps may fail.!
DC solution failed -

If anyone can point me in the right direction to clean up the model and get it to run, that would be amazing!

I am no expert on modeling, but I might do better by having a look at your schematic & pcb files if you want to post them.

Can you describe the malfunction of the hardware? Got any oscilloscope photos?

Is the board only using the PAM2423AECADJR (e.g. it’s some form of power supply board), or is this just powering other stuff on the board?

I ask as I wouldn’t normally bother simulating a regulator. This is assuming you’re not doing something funky that is a big shift from the reference design in the datasheet. For simulation, I’d just replace your regulator circuitry with a VDC voltage source.

The problem is likely to be either incorrect component selection - especially the inductor current rating, or a basic schematic error. Poor layout is more likely to give noisy operation.
Simulation won’t solve any of these.

2 Likes

More Likely is the operative term. Around Y2K my schematic for a switching buck regulator was laid out in my absence by a pcb designer working with no engineering guidance.

It was a terrible layout which seemed to agree perfectly with the schematic; no netlist errors. But I was unable to get the slightest blip of power out of the assembled pcbs.

Yes, it is just a power supply, thats the whole board.

The reason I’m simulating it is that I sent it off to PCBWay, got 5 made, but they dont work as I expected.
I expected to get 12V output, but only get 5V output.


I’ve started poking around with a multimeter, and noticed my FB voltage was about 4V which seemed high as the datasheet describes it as been 1.262V

So, that’s the reason for the simulation, work out what I need to change/fix on this board. Ideally I think if I can change the resister dividers on FB and see the output voltage change, then I would know I have the right values.

I do suspect that layout is the most likely issue.

If you can post any KiCad files and/or oscilloscope photos that can be helpful.

As a practical matter, I do not think one can do much with design of electronic hardware if you do not have access to an oscilloscope.

Yesterday I downloaded the datasheet. I note that there is no pcb layout guidance in this datasheet.

1 Like

Thanks BobZ,

I’ve had a go uploading it all here:

Usual caveat, I’m not an electrician or electrical engineer, simply a hobbyist, so go easy on me, but I would certainly value any constructive feedback.

I do not see pcb or schematic files there?

Can you zip and post the entire project folder?

Also…when you test your board: What is the Load current or load resistance? Do you measure the input voltage when output voltage is too low?

Thanks David,

You are probably correct, I am a hobbyist with no formal qualifications, so I’m always learning.

On the topic of simulation though, I thought running the simulation might be a good way to learn too. In this case, by changing the values of the resistor dividers I could see different outputs.

I started off with 85k + 10k dividers, then changes to 5k + 590 ohm, then changed back. Mathematically it seemed to be the same ratio, but I don’t really understand what impact using one combination or the other would have.

As for component selection, I’ve tried to follow the typical reference from the datasheet as closely as possible to give this the best chance.

Probably not a big deal because the FB input current is 80 nA maximum. That should not cause a significant error and ought to be perfectly OK. I will commonly use 10K as a bottom divider resistor value.

1 Like

Hopefully you can see the Kicad files in Git there ?

I did try putting my 12v load on it, but it failed to power up, I assumed this is because its not delivering enough voltage (measured at 5v).

As mentioned, I’m just a hobbyist, but I did get a Saleae for my birthday, which for me, is a form of scope, however it is limited to 10v analog input, so I don’t think I can use it here.

Coming back to the KiCad simulation though - I think its a great way to apply changes and test circuits and understand their behaviour before moving to the physical world which costs money and may break things if circuits do not behave as intended.

Whilst I appreciate any input/feedback on this small circuit, the topic here was to focus on using the simulator. I dont want to upset the moderators if we stray too far off topic.

Does this help ?



Naturally, people with a lot more experience would do this much better, the layout probably isnt very good, I’m just doing the best I can. The ERC and DRC both seem to “pass” but I appreciate there is a lot more to making a good design that I do not know yet. :slight_smile:

Found the files but cannot open them for some reason. If you could zip the project folder and post it here that would be much better.

Based on your images, I think the layout is um…well…not good.

Thanks BobZ,

I’ll have a look at Github and see what’s going on with the files there.

I feel like I should start another thread about the design, or maybe you could DM me with some tips, I’m open to feedback and learning! Thats just not what this thread was originally about.

Anyone else that might want to simulate the PAM2423 one day might find this thread and get led astray.

OK I did not know that I had magnifiable images. Your layout is really poor…

See if you can solder D2 anode DIRECTLY to U2 pin 8. Solder C4 DIRECTLY between U2 pin 1 and D2 cathode. 1 cm lead length may be too much in this. This is the hot loop.

Then wire C4 + terminal to C5+. This might get you going.

Your board photo shows a good size L1. But the pcb images show what looks like maybe an 0603?? That would be too small.

1 Like

Yes, L1 is suspicious. It has has to not saturate at full current, which needs one of the large size cored inductors. No way a chip inductor will work. The PCB and the photo are not the same design.

The layout is terrible, the output chip capacitor should be directly from the diode cathode back to IC gnd.
And change R4 from 1k to 10k. 1mA is plenty with modern LEDs

1 Like

Thanks Bob, David,

I genuinely appreciate the suggestions. Though if you done mind me asking, I’d like to understand more.

D2 - It’s a diode, it prevents any voltage or “feedback” going back to the PAM2423, I do not understand how the length of the trace changes the function ? … the trace is about 3.5mm, its a simple change to move it as close as possible (eg. directly connected) but I’d like to understand why ?

C4 this was a 10 micro-farad capacitor, I understand this was to act as a noise filter to provide a cleaner output ? I don’t understand how placing this closer to the PAM2423 pin 1 and the diode makes it more effective ? Naturally, the whole copper layer is ground, is this something like the copper ground layer acts as an antenna and placing it further away could mean it creates noise or gets interference ?

Regarding, L1, you are correct, as David also picked up, the first iteration of this board (v0.1) as seen in the picture, I used a 6.8uH inductor as per the datasheet, I chose a large coil type, specifically:

When the boards arrived, I tried it out, and if failed, since then, I have been iterating and trying to work out why it failed and how to make it work. There are other notable differences (sorry for any confusion), the original was designed with a number of 0402’s which were too difficult for me to hand solder and re-work, so in the revisions I changed them all to 0603’s as you see in the v0.4 pictures.

During this refactoring, I assumed that using a chip inductor would save space providing it met the 6.8 micro henry requirement, but obviously, there are other properties the PAM2423 datasheet is not very clear about. Thanks for the advice, happy to switch this back to a coil-type inductor.

Looking at it now, the 0603 inductor was only rated at 5mA where the coil type was 4.2A, significantly larger current capacity and also has much higher resistance (I think), 44 mega-ohm with the coil versus 1.7 ohm with ah chip inductor.

Thanks again for the advice, I’ll incorporate these changes and try to learn from them for the future.

This is where schematics hit physics! You’ll note from the data sheet that this is a PWM (pulse width modulation) converter, operating at about 500khz. The inductor is isolating that modulation, which is present on the SW pin, from the input side, and the various output capacitors are smoothing it.

Any long trace is essentially operating as an antenna, so this RF signal can be coupled between traces. That can cause all kinds of upset if it gets where the regulator doesn’t expect it to be.

The data sheet mentions this in the SW pin description in a cryptic way - it talks of keeping SW traces short to minimise EMI (electromagnetic interference).

1 Like

You have a boost converter. Have a good look at data sheets like this one which do give suggested layouts and how to design the inductor.
https://www.st.com/content/ccc/resource/technical/document/datasheet/03/f9/c4/3d/7f/eb/4c/5e/CD00001232.pdf/files/CD00001232.pdf/jcr:content/translations/en.CD00001232.pdf

4.2A is probably too high, going too high has consequences in resonant frequency, which should be above the switching frequency. This is not an electronics design forum, so I don’t want to do the design for you.

1 Like