Use of motion constraints for robot's movement simulation
In a simple case like the example you can use Limit_location constraint on one axis , but for more general case you can use the follow path constraint



to get the previous configuration :


add follow path constraint with the following settings then click animate path





to take coontrol of the robot position you have to check Fixed position  and use the Offset slider to animate it.
for precise movement, the curve used for constraint is the same one used for creating the frame 
the frame is created with Array modifier and curve modifier as follows :