The link below shows it in action
The machine is really a mechanical analog computer. From left to right it starts with a zero amplitude cam. Then each cam to the right increases amplitude and a 60 degree phase shift. This creates a increasing amplitude wave that moves from left to right across the flag.