I'm trying to build a circuit that limits the current flowing to the load at a specific level. To do this, I'm using a current sensing IC (INA138) and comparators to provide the necessary logic. However, when I try to use more than one comparator in the logic, the simulation bugs out and is never able to load. EDIT: by "bug out" I mean that the program continues iterating infinitely upon attempting to simulate.
This is a simplified version of my circuit with one comparator: (it works fine if the load is set to a level where the current sensing doesn't need to kick in - this is why I'm using a load of 2R).
And this is with two comparators:
This is a simplified version of my circuit; I need to perform other tasks preferably with other comparators before the logic signal is sent to the NPN BJT to open the PFET, so the second comparator probably doesn't look like it's particularly necessary there (I could upload a version of my circuit that's more elaborate for that part but I'm not sure that level of detail would be clarifying).
Is it possible to do what I'm trying to do with multiple comparators feeding into each other? Or should I set up some other elaborate solution involving PFETs or something?
Output between the comparators:
The INA138 is a non-standard LTSpice component. I've made it available at: https://easyupload.io/2e1l4j
EDIT: user @Kuba hasn't forgotten Monica suggested I used some kind of switch to shut off the load. Would this work?
Would this work in principle so long as the capacitor is charged? I've designed it to discharge over 2 seconds but how would I ensure sufficient charge on the capacitor at circuit start?