Adapt robot motion to machine speed as function of error from programmed speed