You are here
The goal of AYAB-Knitting is to be able to program a knitting machine (currently brother 9xx models) with an image from a computer and extending the capabilities of the machines, e.g. the maximum 60 pixel image width. This is achieved by substituting the control of the needles and required identification of the current position and movement of the knitting carriage is substituted by a common Arduino microntroller, combined with a custom developed shield.
In the last few weeks, we were looking at different options to make it easier for users to work on knitting machines and we came up with an idea to develop a graphic user interface in cooperation with the AYAB project. Sebastian Oliva from Guatemala will work on this project over summer gratiously funded by Google. Thank you!
What is currently supplied:
- A transparent and lightweight API between the client computer and the Arduino, based on 115.2 kbaud serial communication.
- A proof-of-concept python implementation of the client-side of the API (the machine side is in the firmware of the Arduino).
- A simple python commandline application which uses this implementation.
Ongoing work, that will be supplied shortly as the basis for the GUI project:
- A simple PySide (Python+Qt) based GUI application which uses the API implementation, as a proof-of-concept and starting point for further GUI application development work. It will just have the same functionality as the commandline version, no fancy image processing or so.
- A new firmware version for the Arduino with a debug option to mock-up "end of line" events by pressing a button attached to the Arduino. No AYAB Shield, nor Knitting Machine needed for operation.
The goal of the AYAB project is to provide an alternative way to control the famous Brother KH-9xx knitting machines. There are some similar projects on the interwebs, such as Knitic or, of course, ladyada's electro-knit. The main drawback behind the existing projects is that they make use of the 930/40 series of the knitting machine - which are still pretty expensive. AYAB uses the older KH-910 model, which is cheaper than the other models, mainly because it features an error-prone scanner-mechanism for reading the image data (but we don't care because we won't use the scanner anyway…). The 930/940 series already use some kind of digital programming, which opens even more ways to hack them, other than what this project did. Normally, the KH-910 is programmed using semi-transparent picture cards which are scanned by the machine line by line. Using this information, the machine sets the needles accordingly to achieve the knitting of the picture shown on the picture card. Probably due to memory restrictions, the machine only supports pictures of max. 60 needles (= pixel) width, although the machine has a total width of 200 needles. At least, it is possible to “copy and paste” the scanned image multiple times to achieve a banner-like usage of the scanned data (useful for norwegian patterns). Now what we achieved is that you can just program the knitting machine with an image from your computer. The restriction of 60 pixel image width has been abolished due to the improved control. You can just knit an image with up to 200 pixel width. [https://bitbucket.org/chris007de/ayab-apparat/wiki/Home]
* All Yarns Are Beautiful (AYAB) http://ayab-knitting.com
* Twitter AYAB https://www.twitter.com/AYABApparat
* AYAB Wiki and Documentation
* Current stable Version of AYAB
* KH-9xx hardware prerequisites and Arduino shield Hardware
* API and communication with knitting machine
* Needlework Knitting Starter
* Knittic http://www.knitic.com
A video tutorial that was already published 2010 by Becky Stern gives a great overview of the proces to work with a hacked brother knitting machine KH-930e. The hack is based on the work of Steve Conklin and published on github here: https://github.com/adafruit/knitting_machine
The Brother KH-930e Knitting Machine can be controlled by Open Source software. Parts of the process require commandline experience and Python knowledge.
Disk Drive/Computer Connection Notes
The external floppy drive for this machine was the same as a Tandy PDD1 (Portable Disk Drive 1). This drive is connected using a serial port. There is documentation on the internet about how to connect these drives to computers, but the connector pinout on the knitting machine is different than the drive, and I didn't find that documentation to be helpful. I was able to figure out the connector pinout by examining the knitting machine PCB.
Knitting Machine/Computer Connection Notes
The knitting machine drive connection uses CMOS voltage levels, not RS-232. Here is the pinout of the drive connector on the knitting machine:
_____ | | ______|___|______ | | | | | | 7 | 5 | 3 | 1 | |___|___|___|___| | | | | | | 8 | 6 | 4 | 2 | |___|___|___|___|
The pin numbering is shown as they are labeled on the knitting machine PCB, and does not agree with other documents I found on the web.
|2||Out||Tied to 5, Pulled up through 1K resistor|
|3||CTS?||In||(Tie to pin 2)|
|5||Out||Tied to 2, Pulled up through 1K resistor|
|8||RTS?||Out||Follows state of Pin 3 (buffered)|
Methods of connecting the knitting machine to a computer
Using a FTDI serial adapter cable (RECOMMENDED)
Using an FTDI adapter is the best way to assure that you are interfacing with the machine using the same signal voltages as the original external floppy drives. This is documented on this wiki page, which will someday be merged with this one.MProg only runs under windows.
Using a USB serial adapter WITH flow control
This is a method I have used extensively with one model of knitting machine, but I no longer recommend it. Although it does not require any additional hardware like a FTDI adapter, this method does not present the exact same voltage levels to the knitting machine as the external drives which were designed to work with the machine. Although I have not had any reports of problems, it is possible that this method could stress the knitting machine input circuitry, and therefore I think it is safest not to use it.
|Cable connections with flow control|
|Knitter||9 pin connector|
Using a USB serial adapter WITHOUT flow control
I have pulled pin 3 high, and am not using flow control in my software. I have not had problems with data loss while sending to the knitting machine, and the machine I am using is fast enough to always keep up with data received from the knitting machine. The data rate is 9600 bps, and the largest amount of data sent at once is 1024 bytes. Here is the cable I am using to connect the knitter with a USB 9 pin serial port:
|Cable connections without flow control|
|Knitter||9 pin connector|
|2 tie to 3|
Software Interface Information
There are a number of documents on the web about the Tandy PDD1 and the serial API for it, Most of them are incomplete. The knitter places the drive into a mode called "FDC emulation Mode", which allows access to raw sectors. This document is the most complete documentation I was able to find: Media:Tandy-Disk-Reference.pdf
External Disk Drive Emulator
I have written software that emulates the external disk. It runs under Linux and keeps the data as files on the linux file system. This allows knitting designs to be saved and restored using the emulation computer. I am using these files to reverse-engineer the knitting machine file format. The emulator is written in Python, and released under the GPL. It has been tested most extensively under Ubuntu Linux. I have reports that it does not work on windows due to problems with the serial library. It has been successfully run under OSX. If you have any information to add about platforms that it does or doesn't work on, let me know and I will update this informationI am happy to work with people who are trying to use the emulator with different models of knitting machine, and hoep to improve compatibility with other machines. The source code is available in the git repository listed above. Software for manipulating Brother data file: I have begun a python class which will provide an API to the brother data files. Source code is in the git repo. Knitting Machine File Format: A lot of the file format is now understood. Documentation is in the git repo.Work on this continues.This work was greatly helped by prior work performed by John R. Hogerhuis and posted on the kminternals yahoo group.
BL5 Brotherlink 5 serial or USB cable Brotherlink information
Brother Liberation Front is working on open source interfaces
Info and protocols for the FB-100 interface
KE-100 motor drive (not sure that this is the right model drive for the KH-930E)
Adafruit Tutorial: https://learn.adafruit.com/electroknit?view=all