high speed optocoupler circuit
You need a pull-up resistor on the output side of the opto, like this:







simulate this circuit &ndash; Schematic created using CircuitLab

If the output transistor's emitter is grounded, it can only pull the collector towards ground, or let it float.  To ensure the motor driver receives a "High" when the transistor is off, you need to add the pull-up resistor.