I have found out that its caused by lack of setup time between dir and step. I fixed by setting direction pin when actually direction changes. and delaying 17us. ( even delaying 10us causes slips for me :( ).
I didnt touch setOutputPins function. Just removed setOutputPins function from step1, changing into
---------------------
digitalWrite(_pin[0], ((_direction ? 0b11 : 0b01) & (1 << 0)) ? (HIGH ^ _pinInverted[0]) : (LOW ^ _pinInverted[0]));
delayMicroseconds(_minPulseWidth);
digitalWrite(_pin[0], ((_direction ? 0b10 : 0b00) & (1 << 0)) ? (HIGH ^ _pinInverted[0]) : (LOW ^ _pinInverted[0]));
--------------------
Below is setting of direction pin if _direction changed. Similar code is everywhere where _direction is assigned ( except constructor ). Below code is from runSpeedToPosition()
-------------------------
bool old_dir = _direction;
if (_targetPos >_currentPos)
_direction = DIRECTION_CW;
else
_direction = DIRECTION_CCW;
if( old_dir != _direction )
{
digitalWrite(_pin[1], ((_direction ? 0b10 : 0b00) & (1 << 1)) ? (HIGH ^ _pinInverted[1]) : (LOW ^ _pinInverted[1]));
delayMicroseconds(17);
}
---------------------------
Also I have set DIR pin if setPinsInverted called. Before function ends.