Why doesn't my PCB and simulation perform the same?

Thread Starter

bmbouter

Joined May 29, 2021
75
See the attached schematic (which is made into a PCB) and .asc file. The circuit and PCB perform similarly in many ways, except one: The simulation says that when power is applied to BAT+ (with V1 in the sim), the ENABLE label reaches a steady state of 0V. The PCB has it reach a steady state of 3.8V. On the PCB the ENABLE label actually connecting to a RT9013 and GPIO4 to an ESP8266, but the problem exists even if I physically cut ENABLE and GPIO4 entirely from the RT9013 and ESP8266, so the simulation should be very close to the PCB with no external circuitry influencing it. I have 5 PCBs and they all perform the same, so it's likely it is a design issue and not a PCB production issue.

One interesting thing is the value of R5 (on the sim model), a value of 10K converges in Sim to 0, but a value 20K converges the Sim to 3.8V. In practice the PCB has 10K as its value, but I want to point out the significance of that resistor.

What could be the issue could be here? The circuit has few components, they seem identical to me, how could they be different?

Also how could I model the RT9013 given I don't see a spice model for it from the manufacturer?
 

Attachments

BobTPH

Joined Jun 5, 2013
8,812
What is the circuit supposed supposed to do? I cannot make sense of it.

Also, is the off board switch closed or open?

And is GPIO4 an input or output?
 

Alec_t

Joined Sep 17, 2013
14,280
One interesting thing is the value of R5 (on the sim model), a value of 10K converges in Sim to 0, but a value 20K converges the Sim to 3.8V.
? Both values of R5 give V(enable) = 3.8V when I run the sim with FETS AO6407 and AO6408 and diode D1 = default.
 

Thread Starter

bmbouter

Joined May 29, 2021
75
@BobTPH, The circuit uses a momentary push button to provide BAT+ power to the ENABLE portion of the circuit. Then while on, if another <3 second momentary push occurs power stays on but the GPIO4 line is pulled low (its an event for the 8266 to handle). If the momentary push is held for > 3 seconds the BAT+ power to ENABLE is removed. For more background see the original design on this site.

@Alec_t, interesting I need to try this out. Share an .asc file if you happen to have one, or I will if I get the same result. Thanks!
 

BobTPH

Joined Jun 5, 2013
8,812
It appears that the micro is involved in the operation of this circuit, switching the gpio from input to output and setting it to low. Have you programmed the micro to do this?
 

drjohsmith

Joined Dec 13, 2021
852
How are you modelling the fets ?
the correlation between reality and the sim parts is going to be critical

the fact the resistor change affects the voltage, seems to imply your circuit is marginal.

Is this your design ?
how do you expect the circuit to work ?
 

eetech00

Joined Jun 8, 2013
3,858
Connect a 0.1u cap from Q5 gate to ground as a por for Q5.

the hold off delay is heavily dependent on the VGS(th) of Q5. It may be the button is not held long enough.
C10/R16 determine the hold ofdelay.
C7 is not needed.

Try a 2N7000 for Q5.
 

eetech00

Joined Jun 8, 2013
3,858
Here is an alternative circuit.
I showed two buttons but they are only used to simulate short and long button presses. Only one momentary button is actually required. Delay is set by R2/C1.

Edit: The first two traces show PB status, 1v=closed, 0v=open

1665246047065.png

1665246221224.png
 
Last edited:

Thread Starter

bmbouter

Joined May 29, 2021
75
Thank you all for such wonderful replies!

@eetech00 The 0.1uF cap on Q5 gate to ground indeed does cause the on-behavior to work as expected which is nice. Thanks also for sharing the alternative circuit, which I studied and I learned a lot from. I should have mentioned one of the goals of this design is to have an inexpensive BOM cost. Unfortunately, that's kind of how I ended up with these MOSFET choices to start with.

Going back to my original question; I think there are a few possible differences.

1) I'm simulating with a DMG1012T model from diodes inc, which provides the spice simulation but I'm actually using a much cheaper DMG1012T not made by diodes inc on the PCB. These data sheets are very similar, but not exactly the same. The diodes one is here and the Tech Public one is here.

2) I'm simulating with an AO6407 (datasheet here) but in reality on the PCB it's an FSS2301M (datasheet here). These are much more different, but I think actually it's less likely the differences are from here because the initial on-voltage is highly dependant on the VGS(th) of Q5 (the DMG1012T) not this one, which is Q4.

I think maybe I'm going to try to calculate the Vto and Kp for the FSS2301M and see if I can have the simulation reproduce the issue. Am I insane for approaching the problem like this?
 

Thread Starter

bmbouter

Joined May 29, 2021
75
@drjohsmith the observation that "the fact the resistor change affects the voltage, seems to imply your circuit is marginal." is interesting. When I make R5 (in attached files) 100k using the original DMG1012T in the sim which is also used in the PCB V(enable) goes to 3.8V, and then if I add in C4 (the 0.1uF cap across the M2 gate and ground) any value of R5 works which suggests to me that actually the margin is what is the difference between my PCB and my sim and the additional C4 cap brings a lot of stability, removing that margin.
 

Attachments

eetech00

Joined Jun 8, 2013
3,858
Thank you all for such wonderful replies!

@eetech00 The 0.1uF cap on Q5 gate to ground indeed does cause the on-behavior to work as expected which is nice. Thanks also for sharing the alternative circuit, which I studied and I learned a lot from. I should have mentioned one of the goals of this design is to have an inexpensive BOM cost. Unfortunately, that's kind of how I ended up with these MOSFET choices to start with.
It will cost less than the mosfet approach, will be easier to build, and the parts are readily available.

I think maybe I'm going to try to calculate the Vto and Kp for the FSS2301M and see if I can have the simulation reproduce the issue. Am I insane for approaching the problem like this?
Your approach is probably ok for a one-off PCB. But even parts of the same part number can have variances of VGS(th), so you'll have to take that into account.
I think the digital approach is far better, more reliable, and less sensitive to changes in voltage levels (other than the RC constant which can be easily adjusted).
 

Thread Starter

bmbouter

Joined May 29, 2021
75
I'm really considering using the alternative design (hence my followup). The reliability and predictability is sounding really nice. I don't think it's cheaper though. Who do you use for sourcing components for PCBs? I'm using JLCPCB (aka LCSC) and I came up with the following for the two costs for the non-common components. Maybe I should be sourcing lower-cost alternatives of these chips for the digital design? Any ideas on what could be done to make the digital design have a lower BOM cost with LCSC sourced parts (or another supplier?)

The original 2 mosfet design total: $0.0832
LL4148 - $0.0065
FSS2301M - $0.0195
DMG1012T - $0.0572

The digital design total: $0.5059
PMEG2005AEA - $0.0885
74HC14D - $0.1562
74HC74D - $0.204
DMG1012T - $0.0572 <- a cheaper option NMOS than the AO630_N

As an aside: how did you model the buttons in LTSpice like you did?
 

eetech00

Joined Jun 8, 2013
3,858
I'm really considering using the alternative design (hence my followup). The reliability and predictability is sounding really nice. I don't think it's cheaper though. Who do you use for sourcing components for PCBs? I'm using JLCPCB (aka LCSC) and I came up with the following for the two costs for the non-common components. Maybe I should be sourcing lower-cost alternatives of these chips for the digital design? Any ideas on what could be done to make the digital design have a lower BOM cost with LCSC sourced parts (or another supplier?)

The original 2 mosfet design total: $0.0832
LL4148 - $0.0065
FSS2301M - $0.0195
DMG1012T - $0.0572

The digital design total: $0.5059
PMEG2005AEA - $0.0885
74HC14D - $0.1562
74HC74D - $0.204
DMG1012T - $0.0572 <- a cheaper option NMOS than the AO630_N

As an aside: how did you model the buttons in LTSpice like you did?
Yes...costs a little more but I don't use cheap parts.
But even at $0.50 (fifty cents USD) its worth it.
 

drjohsmith

Joined Dec 13, 2021
852
I'm really considering using the alternative design (hence my followup). The reliability and predictability is sounding really nice. I don't think it's cheaper though. Who do you use for sourcing components for PCBs? I'm using JLCPCB (aka LCSC) and I came up with the following for the two costs for the non-common components. Maybe I should be sourcing lower-cost alternatives of these chips for the digital design? Any ideas on what could be done to make the digital design have a lower BOM cost with LCSC sourced parts (or another supplier?)

The original 2 mosfet design total: $0.0832
LL4148 - $0.0065
FSS2301M - $0.0195
DMG1012T - $0.0572

The digital design total: $0.5059
PMEG2005AEA - $0.0885
74HC14D - $0.1562
74HC74D - $0.204
DMG1012T - $0.0572 <- a cheaper option NMOS than the AO630_N

As an aside: how did you model the buttons in LTSpice like you did?
Cost is not just BOM costs
I assume you will have to test all these boards..test is not zero cost, and what's the cost of a failed board ?
 

Thread Starter

bmbouter

Joined May 29, 2021
75
Thank you both for helping me understand your perspectives here. The reasoning here is making a lot of sense, and I'm going to look into switching my design. I really appreciate learning from you all.
 

Thread Starter

bmbouter

Joined May 29, 2021
75
Would you possibly be able to share the asc file of your alternative circuit? If not I'll try to model it and post it.

Also is 74HC_v.lib from here http://bordodynov.ltwiki.org/
Also how can I learn to model the switches like you do?
Why is the shottky barrier diode important and why that type? (I'm new to all this :/)

Thanks for showing me this other path!
 

Thread Starter

bmbouter

Joined May 29, 2021
75
Attached is what I put together, and it models nicely.

@eetech00 how do I model U1 and U2 in your image? My 74HC** circuits are powered by the component properties, but yours also model C4 and C3 next to U1 and U2. What is U1 and U2 in your schematic exactly?

Also I am truly curious about how you have those very nice switches. As you can see mine use individual power supplies with NMOS to simulate the switch to ground.
 

Attachments

Top