PD control with on-line gravity compensation for robots with flexible link