In this paper, an adaptive friction compensation scheme is proposed. The friction force is computed as a time-varying friction coefficient multiplied by the sign of the velocity and an online update law is designed to estimate this coefficient based on the actual position and velocity errors. Furthermore, a modified signum function definition is proposed to better capture the behavior of friction over varying velocity profiles than the signum function commonly used in friction models. The properties of the closed-loop behavior of the proposed scheme are analyzed and stability of the closed-loop system is proven. Simulations and real-world experimental results are provided to confirm the theoretical findings: the compensator is able to eliminate steady-state errors, significantly decrease the stick-slip effect and compensate even rapidly varying friction forces.