State-periodic adaptive friction compensation