Latching power switch simulation problem - Page 1
Forum section: electronics / projects

author: bodge_wire
author_rank: Newbie
timestamp: January 03, 2021, 04:40:18 pm
content: Hey everyone, I'm trying to design a latching low-side power switch, with a mechanical switch triggering the ON, and a signal triggering the OFF (or reset). The circuit I came up with works in LTspice except for the startup, where it always starts ON, and I don't know why... After the startup, the ON switch and RST signal work as expected. Why does it start ON and how can I ensure it starts OFF?Circuit and plot pictures attached.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 03, 2021, 04:45:56 pm
content: Well, you can just invert the PULSE level.Try initial conditions, set to zero or source ramp.Tim

author: bodge_wire
author_rank: Newbie
timestamp: January 03, 2021, 05:00:37 pm
content: Ok, so I just set the gate of the MOSFET to 0 as an initial condition (.ic V(n006)=0), and now it starts OFF. Thanks for the suggestion Tim! Is this a realistic simulation though? Why wouldn't the gate of the MOSFET start at 0V by default in the simulation?

author: Peabody
author_rank: Super Contributor
timestamp: January 03, 2021, 06:42:21 pm
content: What does startup mean? Is that when you first connect the battery? If so, then "zero volts" at the gate doesn't mean much before then. With reference to what?If the mosfet starts out with all its internal capacitances discharged (no voltage differential between any of the pins), and then a differential suddenly appears across the drain and the source, where is the gate with respect to all that? I don't know, but if it isn't automatically at the same voltage as the source, then the mosfet could turn on until the voltages are equalized through R1, which could take a while, long enough that it would stay on. C1 is supposed to take care of that by bypassing R1 during that sudden change. I don't know why it doesn't in the simulation. You might try different values of C1 and see if it makes any difference - larger and smaller. But to answer your last question, I don't think you can assume the gate is at zero volts at startup. If anything, you should assume there's a reason why the simulation shows it turning on when power is applied.

author: bodge_wire
author_rank: Newbie
timestamp: January 03, 2021, 07:03:28 pm
content: Hey Peabody, thanks for the suggestions. Increasing C1 to 10nF actually did the trick! That's a good point with the drain and source voltages changing instantaneously capacitively coupling to the gate, I didn't think of that. In this case, startup was just t=0 in the simulation.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 03, 2021, 07:34:51 pm
content: Keep in mind what SPICE is. It's an engine to numerically solve nonlinear differential equations. It's not a model of reality, it's an abstract toy. It's up to us, the engineers using it, to build representative models that reflect whatever reality we want to investigate.So, a system of equations needs to have initial conditions. By default, SPICE uses a DC operating point calculation, to find a good candidate for the transient simulation (which time-steps through the equations). This makes a number of assumptions, which needn't be true during the transient simulation, so you sometimes see the operating point drift significantly during a run. (Oscillators are a good example of this.) It seems in this case, it happened to conclude that your bistable circuit was in one particular state; which, it doesn't know anything about intent, it could've just as well been the other way, who knows. So that's why you can set the initial state of transistors, and voltages of capacitors, and currents of inductors.Tim