Variable gains in motion control of wafer scanners