Set reference as function of position, for compensations