robot speed calculation