[Terje Io] decided to breathe new life into an old pen plotter — the CX6000 from C. Itoh, a Japanese company that made several printers for Apple in the 1980s. He keeps most of the framework, but the electronics get a major overhaul. The old motors are replaced, the controller and motor drivers are modernized using a Raspberry Pi Pico and stepper motor drivers. After tending to other auxiliary electronics like the control panel and limit switches, it’s time to deal with the firmware.
Rather than reinvent the wheel, [Terje] sensibly built upon existing projects and refactored them for his application. G-Code processing is done by grblHAL, with an added mode to handle HPGL code. He modified the firmware from Motöri the Plotter project to parse HPGL, making his new CX6000+ bilingual.
Should you happen to have an HP7440A or similar plotter hanging around, you could have a quick game of Flappy Bird — or Plotty Bird as [WesleyAC] calls it. Just be sure you have some blank paper. The whole thing fits in about 200 lines of Rust code and — according to the author — gets to about 20 frames per second.
Watching the thing go, it appears that it draws a random set of pipes and then traces your flight path on the same page in real time.
There is a dedicated community of plotter enthusiasts who keep their often-aging X-Y axis pen drawing devices going decades after they were built, and who share plotter-generated paper artwork online. [Dhananjay Balan] was seduced by this, so acquired a second-hand HP7440A through eBay and set about bringing it to life.
Bringing it to life was in the first instance the usual progression of cleaning the mechanism and checking all was in order, before doing a bit of research to find that the missing power supply was a 10-0-10V AC item. Then some adapters and a USB-to-serial port had it talking to a modern PC, and thanks to the wonders of HPGL it was working once more. This could thus have been a very simple tale worthy of the dreaded Not A Hack moniker, had the focus then not changed from the hardware into the software.
Back in the day, a 60-byte buffer in a plotter must have seemed huge. But in 2019 a plotter can be sent data at a rate that will swiftly fill it, after which the commands are not stored and are never drawn. Introducing a delay between sending commands solves the problem, but at the expense of very slow plotting. This was solved with a very clever use of the HPGL command to send the pen position, which waits until the pen has finished moving before sending its return value. This became a handy way to detect when the plotter was ready for more, allowing speedier printing without buffer overruns.
The plotter has an expansion port into which an optional module containing trigonometric drawing functions could have been plugged, but was missing in this example. HP’s idea was that the buffer was so small that a programmer would have difficulty writing their own, but the buffer hack in the previous paragraph put paid to that. Python code for all this and more is in a handy GitHub repository.