So I basically designed a circuit to limit the current flowing through a 250 ohm resistor by shutting down the current path using a mosfet when current goes above 30 ma:
R1 is the 250 ohm resistor that needs to be protected from over-current.
R4 and R6 create a voltage of 7.5 voltage for the comparator
R5 and R3 limit the voltage falling on mosfet gate to 10 volts.
if more than 30 ma pass through R1, the generated voltage will go above 7.5 volt and the op-Amp output will become zero shutting down the mosfet.
I have a slight problem. When v1 (is equal to zero volts) the currents of negative and positive op-amp inputs are +/-2.5 ma.
If I increase v1 to 4 volts, aforementioned currents reduce to 1 ma.
At v1 = 10 volts, they reduce to 250ua.
These values are too high. According to the datasheet of the op-amp, the input bias and offset currents shouldn't have exceeded 1.5na.
What am I doing wrong? What is the problem here?
In fact the output of the op-amp never becomes zero and R4 and R6 never create the 7.5 volt reference for the comparator. The voltage is always lower even going down to about 3 volts when v1 =0.
P.S. Simulations are performed using LTSpice.