I'm working on a relay drive circuit, and one of the requirements is to have some kind of analog shutdown functionality for an overcurrent condition. I came up with a circuit in LTspice that seems to work okay, but I'm a little lost on how to handle analysis of the circuit. I would like to define an expression which relates two resistors to the maximum current limit of the circuit. I would also like to determine how temperature will play into the current setpoint. I'm not asking for a fully-fledged solution, but just some directions to search and some ways to attack the problem.
I've attached a simulation of the circuit and will reference the designators from that here.
I was originally working with the circuit without R1. As far as I understood it just by looking at the circuit, a voltage of around 0.7V would push Q3 into saturation and clamp M1's Vgs to 0V. This would shut off current through the sense resistor and set the gate high again. From there, the current would switch on and off through M1. The point of the cap C1 was to adjust the switching time.
After simulating, I found that this was not the case. When in the overcurrent state, Q3 does not switch all the way off, but instead adjusts its voltage based around the amount of current through R3. This pulls M1 into the linear region to regulate the current into the load instead of switching it on and off. The only issue is that the current limit without R1 is based solely on the transistor parameters of Q3, which is undesirable. I would like to be able to control that current setpoint, which is why I added R1. Because M1 is in the linear region, the overcurrent limit which the values of R1 and R6 set are not as easy to calculate with just voltage divider rules. I want to know how to set these two resistors for a certain current limit.
From a digital control perspective, this is exactly what I want because I'm also monitoring the current into the load via R3 (not shown in the simulation, but it's just a current-sense amp). Should an overcurrent event occur, the processor could notice without the current switching back off again. I can still keep M1 within the SOA because of the overcurrent circuit, but the overcurrent event is detectable by my processor. This is why I have chosen not to go with a comparator overcurrent detection which performs the switching action described above.
I've simply adjusted the two resistors via tuning in LTspice, but I'm betting that parasitics will play a role once this is actually built up. I would like to have a deeper understanding of how to adjust this on-the-fly beyond just knowing a simple relationship in LTspice. From my understanding, the Q3-R1-R6-R3 loop is acting like a transimpedance amplifier which watches the current on the resistor R3 and adjusts the gate-source voltage accordingly. I'm a little lost in how to analyze this though and any help would be much appreciated.
FYI, I've just used generic components in the LTspice model and didn't analyze current limits or anything. Just wanted to get the simulation to work.