Saturday, May 18

Plot Your Way Past A Tiny Buffer

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.

Via Hacker News.

1 comment:

  1. The info is helpful. Thanks for sharing.

    We provide assistance with HP Printer installation. This includes
    123.hp.com/setup unboxing of the printer, driver download, as well as
    networking setup. We assist you in connecting devices using wireless
    or wired networks. With our help you can download HP's smart app
    effortlessly and swiftly.

    hp.com/123 | www.hp.com/123

    ReplyDelete