You need to detect a change in RPM instantly and brake the motor with a pulse of reverse
Easier said than done..... often the gear will encounter 'resistance' at different stages of its travel from cycle to cycle, maybe retracting gear at different speeds following take off etc so 'when' exactly do you tell the motor to stop as there is a strong chance it will stop mid cycle?
With current sensing which is still not ideal I admit you can dial in some 'allowance' and therefore avoid some cases of hung gear.
In an ideal world what is actually required is a limit switch at each end of the retract unit, positioned so it trips the electronics and allows the unit to avoid the 'crunch zone' - on big retracts this I doubt would be a problem if they were designed/made to accommodate this, smaller units pose problems simply due to being small.
marcs