Problem with Constant Current power supply
I think I got the problem. Originally, this circuit used a TL081 as a comparator. I changed it to LM311, because why not. This is what caused the trouble. The TL081 has a JFET input stage, while the LM311 has transistors. Transistors are controlled with current, so there is an input current.That is why I have measured voltage on the input tied to ground through a resistor. And that is why the comparator latched. Made some mods to the pcb(it looks like it's done by a one handed blind apprentice), and just threw in a TL071. Now it seems like working, at least the comparator is not latching. But this thing has small issues, but those can be solved by changing a few resistors. Thank you all for trying to help!