Look at this post:
unipolar motor microstepping
Many techniques are proprietary, in general terms, as Mariss point out, you introduce a compensating phase shift (+/- 60 degrees maximum) on the incoming step pulses in response to the phase difference between the input step frequency and the real rotor frequency. The rotor frequency could be measured by means of a encoder, BEMF zero crossing, or use the synchronous detection feature of the output switching measured on the current sense resistors and extracting the error information by means of a low pass filter followed by DC suppression (actually a bandpass filter).
I can't give more information on the procedure because it is a patented subject, but you can find out for yourself...