The main issue was that the motor started going off without stopping, when I pressed the stop button on the imaging loop. I think that should not have happened.
I was also connected to the focuser with the iPad via the wifi link for monitoring the position. Maybe that was the problem.