The invention relates to a knitting
machine and particularly relates to a controller for a
yarn changer. The controller comprises a controller skeleton arranged on an outer plate of a
yarn changer main body, a transfer bar, a digital circuit and a drive mechanism for driving the transfer bar to carry out
linear motion, wherein the transfer bar is connected with the controller skeleton in a sliding manner; the transfer bar drives a
yarn clamping and shearing device of the yarn changer to complete yarn selecting and yarn guiding actions while carrying out
linear motion; the digital circuit and the drive mechanism are arranged on the controller skeleton separately; and the digital circuit is electrically connected with a drive mechanism. External drive is not needed, and the drive mechanism can be controlled to drive the transfer bar to carry out
linear motion by virtue of the digital circuit, so that the transfer bar drives the yarn clamping and shearing device to complete the yarn selecting and yarn guiding actions, and independent control on yarn selecting and yarn guiding of the yarn changer is achieved; and the controller is small in
impact vibration, high in applicability, stable in working, simple in structure and beneficial to improvement of the production stability of the knitting
machine.