The invention relates to a positioning system for at least one flexible tubular element (5, 6, 9) connected to a cup-shaped member (4, 8). The positioning system comprises a control unit (14) which is arranged to estimate an individually adapted release length of the tubular element (5, 6, 9) in response to information from sensing means (12, 13a, 13b) arranged to sense a parameter allowing estimation of the position of a teat of an animal (1). Said control unit (14) is also arranged to control the positioning mechanism such that it adjusts the release length of the tubular element (5, 6, 9) to the estimated individually adapted release length.