Needle Capture Mechanism

Input: pink shaft carrying a gear and a face cam.
Thanks to the cam, when grey cylinder turns 1 revolution, yellow arm moves out and in several times. The number of its motion depends on transmission ration of a train of four gears.
This mechanism is used for capturing needles in knitting machines.