The controller needs to know if the motor is still producing "back EMF" because it has not spun down yet.
You need two "differential comparators", like LM311s. They have to be set up with a small "dead-band" in the middle. Practically, the "common mode" input range of the comparators must span the peak motor voltages. Three of the four states will be useful: 10 = +polarity, 00 = stopped, 01 = -polarity.
Or, if you are using a ucontroller, with an ADC, use an OpAmp configured as a "diffamp", with an offset so that zero motor voltage is half-scale on the ADC.