Rolling noise is a significant contributor to railway noise. Wheel and rail roughness are decisive for the emitted noise level. An optical measurement method installed on a moving train is suitable for closer monitoring of the rail surface condition. A measurement setup based on the chord method requires the sensors to be positioned in a straight line along the direction of measurement and in a stable lateral position. Measurements should always be performed within the shiny and uncorroded running surface, even when there are lateral movements of the train. In this study, concepts for the detection of the running surface and the compensation of lateral movements are investigated in a laboratory setting. The setup consists of a vertical lathe with a ring-shaped workpiece that incorporates an implemented artificial running surface. The detection of the running surface based on laser triangulation sensors and a laser profilometer is investigated. It is shown that the running surface can be detected using a laser profilometer that measures the intensity of the reflected laser light. It is possible to detect the lateral position and the width of the running surface. A linear positioning system is proposed to adjust the lateral position of the sensors based on the running surface detection of the laser profilometer. When the lateral position of the measuring sensor is disturbed by a movement with a wavelength of18.85m, the linear positioning system can keep the laser triangulation sensor inside the running surface for98.44%of the measured data points at a velocity of approximately7.5kmh−1. The mean positioning error is1.40mm. By implementing the proposed system on the train, future studies can be conducted to examine the lateral position of the running surface as a function of the various operational parameters of the train.