A chain drive that can itself reverse motion direction of the chain.
On the sketch: the orange sprocket is driving, the two large chain wheels are driven.
The animation shows the driving sprocket and chain behavior at reverse time: from the left-to-right motion of the chain to the right-to-left motion. For the reverse from the right-to-left motion of the chain to the left-to-right motion, the process is similar, the chain moves from the lower side of the orange sprocket to the the upper side.
The yellow leading plate and the pink link are key parts.
Time between two consecutive reverses depends on the chain length.