A patterning device for a tufting machine including a rotary shaft carrying three cams and driven in timed relationship with the tufting machine. Two of the cams each act to cyclically oscillate a respective pawl carrying carriage in opposite directions toward and away from the other during a substantial portion of each cycle. Two sets of ratchet teeth one for each pawl are secured to an output drive member which may be coupled to a tufting machine fabric or needle bar shifting system. A programmable pattern controller drive in synchronization with the shaft selectively controls the engagement of the pawls with the respective set of ratchet teeth during a portion of the cycle when each carrier is moving in a first non-coupling direction and when the directions reverse motion is transmitted to the ratchet by the engaged pawl. The third cam controls a locking tooth to cyclically engage with and disengage from a set of teeth in a locking and alignment plate secured to the output drive member. The locking tooth is engaged during a major portion of every cycle and controllably releases the output drive member only during that portion of the cycle in which the pawl carriers are moving in the motion transmitting direction.