Using sampx and sampy instead of hor and ver motors to calculate new position of grid