That’s going to be a loooong story so bear with me.
I’m trying to develop a board based on Infineon’s MA 12070p.
By looking at Infineon’s evaluation boards I saw an interesting “On/off switching, reverse polarity and hot-plug protection” circuit described in sect. 5.2 here:
I couldn’t find any online references describing this kind of circuit (if anyone has one, I’d be happy to check it out), so I decided to put KiCad’s simulation capabilities to work and see what I could come up with.
I went to replicated the circuit in KiCad. First problem: no simulation models is available for the “IRF9358 - -30V Dual P-Channel HEXFET Power MOSFET in a SO-8 package” that is used there.
So I looked for another part from Infineon that looked to me functionally similar with a spice model for it, and I found this: “IRF9310 - -30V Single P-Channel HEXFET Power MOSFET in a SO-8 package” (spice model here) and I used two of these instead of the single IRF9358.
I simulated a single pulse 0 to 12V power source and I expected the voltage on the output resistor to gradually climb to 12V, the idea was then to play with different power source patterns and see what happens.
Well, I miserably failed, the output signal is an exact mirror of the input one.
What am I missing?
I see several possible issues:
I just misunderstood how the circuit is expected to behave;
the IRF9310 substitution might not be suitable;
the circuit may not be set up correctly in KiCad;
I could be misusing the simulation tool (but I played with it with simpler circuits and I’m able to obtain the intended output).
Please note that I’m a total newbie here: this is my first time using KiCad and a circuit simulator. I studied electronics in high school almost 40 years ago, but I switched to computer science and never looked back—until recently. While I understand the basic concepts, I have zero familiarity with the tools.
Draw the circuit
Attach the model
Care for the pin sequence <-------------- this might be the problem.
KiCad symbols are derived from data sheets, including the pin numbering. Device models may have a different pin numbering. One has to translate between the two.
However, difficult to figure out without further information.
Nice try. I had, in fact, totally missed the potential pins mismatch stuff.
However, it appears to be fine in this case.
The assignment I see in the “Pin Assignment” tab for the “Simulation Model Editor” dialog is (Symbol Pin - Model Pin): 1 (D) - 12 (G) - 2 and 3 (S) - 3.
The comments in the irf9310pbf.spi model read:
Your pinning is off.
IRF9310PBF has the following pinning:
1,2,3: S
4: G
5,6,7,8: D
There’s no way that will match up with the sim model.
I suggest you use Q_PMOS_DGS from the “Device” library in your schematic and see how that works for simulation (no pin substitution needed).
Take it from there.
There is a way dealing with this issue, albeit more complex: creating a ngspice subcircuit to translate between the 3-pin model and the 8-pin circuit.
This may be off-topic, as we do not know which symbol @morci has been using, and choosing the Q_PMOS_DGS is a good solution, when only simulating, not creating a PCB, but here it is:
The subcircuit frame with 8 pins according to the symbol:
.subckt IRF9310PBF s s s g d d d d
.ends
Now load the model file:
.subckt IRF9310PBFsym s s s g d d d d
.include <path, if required/>irf9310pbf.spi
.ends
Call the model from the model file, by calling the top subcircuit in the model file, using its subcircuit name ‘irf9310pbf’ and its pin sequence D G S:
.subckt IRF9310PBFsym s s s g d d d d
.include <path, if required/>irf9310pbf.spi
Xirf9310 d g s irf9310pbf
.ends
Put this subcircuit into a file, e.g. named IRF9310PBFsym.lib.
My bad, I forgot to mention that: that’s what I already did (more or less). The symbol I put in the schematics was IRF9383M which has a three pin package, then I used the model in irf9310pbf.spi as its simulation model.
Now I’m trying with an elementary circuit to check the model, but I’m having an unexpected on/off behavior with no linear zone. I have to dig deeper and I will eventually report here.
And yes, if I have to design a PCB I’ll have to go with @hoger’s solution (thanks for that).
You can be proud of yourself. Beginners usually have completely different (and simpler) ‘first problems’ using KiCad.
I’m using KiCad since 2017 and didn’t get yet to simulate my circuits and don’t plan to do it ever. I have only once tried that simulation works for simple RLC circuit and it is all.
The behavior of the elementary circuit (a high-side input switch) was just fine, I was wrongly expecting a larger transient state.
So it seems like simulation is not a problem, the problem is the original circuit.
How is that supposed to behave???
Now that I can post images I’m pasting it here:
The notes say:
External power supplies with some length of connecting wire are to be expected for this application. These wires effectively create a series of inductance with the amplifier board. Combined with low-impedance decoupling of the supply line on the amplifier board, large peaks/ringing will occur when connecting the external power supply due to this L-C circuit. [...] The large DV/dt and magnitude of these peaks can trigger the ESD protecting circuitry in the MA12070 device, leading to fatal destruction of the silicon. Slowing down the transition on-time of the MOSFETs makes the PVDD rise slowly and eliminates this problem. This is done by an R-C time constant on the VGS of the MOSFETs.
The last part is the one I would like to check via simulation.
The missing elements in the model are, obviously, the amplifier itself and the speaker(s).
I tried with a simple 8 Ohm resistance, just for testing, but I only got square waves. That was probably just too simple.
Maybe the speaker could be simulated with an equivalent circuit based on the T/S parameters of an existing device, but about the ampli? This stuff has a charge pump (and other amenities) that is obviously going to affect the load impedance.
What’s the right approach to use in these cases?
Copy and paste the circuit and hope that the R-C network is good enough for the current use case is clearly the simplest solution, but I would like to apply a moderately more informed approach…
The MOSFETS in U5 are used as an analog switch. The RC filter R12 and C13 are used to slow down the turn-on and turn-off times of the MOSFETS.
With switch SW3 in the off position as shown, pins 3 and 6 are open, no current flows in R28. The body diode in U5A (pins 1, 2, 7, 8) pulls pin 1 to 12 V and R12 discharges C13 and pulls pin 2 to 12 V, so R15 charges C60 to 12 V. The MOSFET have 0 V Vgs (since pins 1 and 2 are the same voltage) and they are off.
Now when SW3 is turned on, pins 3 and 6 are connected to GND. C60 is discharged through R28 which gradually reduces the voltage on C60 and hence gradually increases the current in R15 and R17. The voltage at U5 pin 2 gradually drops as the current in R15 and R17 increases while at the same time charging C13 and the Vgs of the MOSFETS gradually increases. The MOSFETs slowly turn on allowing current to pass from pins 7,8 to pins 5,6. Eventually C60 is discharges to near 0 V (12 * 680/(680+33K+47K = 101 mV), and C13 is charged to about 7 V ((12 - 0.101) * (47K/(47K+33K)) = 6.99 V).
When SW3 is opened again, C60 will gradually charge through R15 and C13 will gradually discharge through R17 until the Vgs is 0 V again and the MOSFETs turn off.
To simulate you need to add a load current or resistance at PVDD and a supply voltage at U5 pins 7 and 8. You could add a small inductance between the voltage source and U5 pins 7 and 8 if you want to see the overvoltage problem caused by large inrush current thought the series inductance of the power input wiring.
OK, first of all thanks a lot @Dennisch for such a detailed response, really appreciated.
However, what you describe as “gradual” seems to be quite instantaneous.
And I also get some weird response, so I went into trying to understand a bit better what happens at the gates of the two MOSFETs when the circuit is powered on.
First of all, the leftmost MOSFET really just works as a reverse polarity protection at this point, so we can easily simplify the circuit by removing it.
We are not really interested in the rightmost MOSFETs either, since there is not feedback from its drain pin back to the gates.
This leaves us with the following circuit:
That was expected. We have C60 loading via R12 and R15 but we also have C13 that sees a square wave at its pin so it works like a short circuit for a very small amount of time bringing V2 instantaneously to 12V with a charge that is very soon absorbed by C60.
So far so good. Putting back the MOSFETs should not change this specific behavior.
Geez. This thing transfers current to the load as soon as the barrel plug in inserted even when the power button is off!
But I’m digressing here. The point of interest was the soft-start thing.
Of which I see no trace here.
If I simulate the activation of switch SW38 here is what I get.