The invention relates to a grating device (50) for phase contrast and/or dark-field imaging of a movable object (34), an interferometer unit (20), a phase contrast and/or dark-field imaging system (10), a phase contrast and/or dark-field imaging method, a computer program element for controlling such device and a computer readable medium having stored such computer program element. The grating device (50) comprises a grating unit (51), an actuation unit (52), a motion detecting unit (53), and a control unit (54). The actuation unit (52) is configured to position the grating unit (51) in different sampling positions relative to the moveable object (34). The motion detecting unit (53) is configured to detect a motion of the movable object (34). The detected motion of the moveable object (34) may be a repetitive motion. The control unit (54) is configured to control the actuation unit (52) to position the grating unit (51) in the different sampling positions based on the detected motion of the movable object (34).