A robotic
milking system (1) has
milking means, and a
robotic arm (3) having a teat detection
system (5). The teat detection
system has a
laser source (10) for a
laser beam (11, 12), a movable
laser mirror (20, 25), a camera (8) for images of the laser beam on an object such as a teat, and an
image processing device (9) for determining teat positions from the images, as well as a
control system (40) for moving the mirror, having a coil (21, 27) with coil poles, and a power supply device for an adjustable current li. The power supply device has a DC power supply source (43) having a positive pole and a negative pole, switching elements, a current-measuring device, and a control, for the steps a) at tstart, connecting the power supply device to the coil poles until lm has risen to li + b or fallen to li - b, where b is a
current range, b) disconnecting the coil pole from the
DC voltage supply source, and connecting the coil poles until at least Tstart + T, where T is a switching period, c) connecting the power supply device to the coil poles with
reversed polarity until, at t2, lm has fallen to li - b, or risen to li + b, d) connecting the coil poles until at least Tstart +2T, and e) updating Tstart to Tstart = max[Tstart + 2T; t2 + T]. A flexible, fast, stable and reliable laser
beam control is thus obtained. This enables fast and effective teat detection, so that teat cups can be efficiently connected.