Detecting motor stall with lm311
There are a couple of problems here. 

Firstly, you are connecting an input to the positive supply rail (pin 3 -Vin) - this won't work - the LM311 isn't a rail-to-rail device and if you were powering from (say) +15V the data sheet tells you that the usable input range is up to 13.8 volts.

Given that your top supply is +24V you must not assume that inputs can be taken as high or higher than 22.8 volts.

Next, you really need to engineer a solution that allows the voltages on the two inputs to cross each other - this guarantees switching operation on the output. Unfortunately you have -Vin always set to a voltage that +Vin can only aspire to reach.

What you probably want is a high-side current monitor. If I remember correctly Linear Technology make some: -



Maxim have a few options: -