An intro to Pen Plotters

Tobias Toft on 2019-05-02

I originally posted this on my website back in July 2014. It seems that interest in pen plotters has picked up recently, so I decided to move the post to Medium which is arguably a much better place for it.

HP 7475A plotter — I paid $50 for it on eBay. The Delaunay triangulated Marilyn was one of my first experiments.

I’ve been fascinated with pen plotters for a long time now and I’ve owned several of them — but for some reason never posted any of my explorations or findings online. Until now, at least.

You might wonder what’s so special about pen plotters? Well, let me tell you. Pen plotters are friendly robots from a not so distant past. They’re the missing link between pencils and laser printers. They’re lovely pieces of high precision technology that nobody cares about anymore. They’re computer controlled machines that use regular pens to draw on regular paper with incredible speed and precision. They would draw blueprints for tweedy engineers and turtlenecked architects back in the 70’s and 80’s, they would draw colorful charts on transparencies for slick investment bankers to present on overhead projectors, and they probably also drew the schematics for the laser- and inkjet printers that replaced them a decade later. They were expensive, beautifully engineered, high quality machines. Which means that there are still plenty of them around, fully working and very cheap. You can, for instance, pick up an HP 7475A on eBay for roughly $50, it’s a great starter machine and I can’t recommend it enough.

They’re purely made for drawing though, so you can’t print a book with them (unless you want a certain style to it), and they would suck at printing holiday photos or boarding passes. But they excel at crisp line drawings with a wonderful analog feel.

A closeup of the 7475A’s line quality when using a slightly worn felt tip pen on rough paper. No pixels, lots of personality.

Talking to them

There is one minor problem though, and that is that you can’t just hook them up to your laptop and start plotting things from Illustrator: They speak a language that most operating systems have forgotten. Luckily it’s a pretty simple language, so with minimal coding skills you can start plotting like it’s 1984.

Here’s what you’ll (probably) need to get started:

Most plotters run their serial connection at 9600/8-N-1 as default unless somebody changed the settings. Depending on your plotter you might have some dip switches on the back near the port or a setting in the menu on the front panel. Consult your manual on how to set up the connection — most manuals can be found by Googling the plotter’s make and model. It might take a little trial and error to get it working, but it shouldn’t be too hard.

Let’s jump straight to the fun part: Drawing.

First, load some paper in the plotter and put a pen in the carousel or pen holder at slot number 1. Open your terminal emulator of choice and connect to the plotter. You probably won’t see any response from the machine. Test if it works by typing (or copy-pasting) the following:

IN;
SP1;
PA2000,2000;
CI500;

This will tell the plotter to first initialize (IN), select pen 1 (SP1), go to absolute position (PA) at (2000, 2000) and then draw a circle (CI) with a radius of 500 plotter units. Did it do that? If not, check your connection — again, the manual is invaluable in these situations. Got it working? Awesome!

If you’ve never played with plotters before, then this was probably also your first introduction to the language that most plotters speak: HPGL (Hewlett Packard Graphics Language). Even if you don’t have an HP plotter, it probably still speaks HPGL or HPGL/2. There are lots of great resources online about HPGL, so I’ll only introduce a few basic commands here.

Moving the pen around

I’m sure you’ve already figured out how to select a pen with SP, but just in case: SP1; selects pen 1, SP2; selects pen 2, SP3; selects pen 3, etc.

Moving the pen is almost as simple. The two most important commands are:

PU;

and

PD;

PU; means “Pen Up” and PD; means… yep, “Pen Down”. Now, if you add an XY coordinate after those two commands, the plotter will move to that position after either setting the pen down or lifting it up from the paper. By the way, don’t forget that semicolon at the end:

For instance:

PU500,500;

Will lift the pen, and move to (500,500).

PD500,1000;

Will then set the pen down and move to (500,1000). In other words, it’ll draw a line from (500,500) to (500,1000). Try it.

You’ll notice that if you end your sequence with PD, the plotter won’t lift the pen from the paper and the ink will start to bleed through. It’s therefore a good idea to issue PU; after drawing a shape to avoid that.

Here’s how to draw a box with these very basic commands:

PU1000,1000;
PD1000,2000;
PD2000,2000;
PD2000,1000;
PD1000,1000;
PU;

If you read those lines carefully you’ll see that we told the plotter to go to (1000,1000), put the pen down and go to (1000,2000), while keeping the pen down, move to (2000,2000), then (2000,1000) and finally back to (1000,1000) and lift the pen. While it’s easy to appreciate the simplicity of that, it might not be the most efficient way to draw a box. More on that later, because I know that you want to put a circle inside that box first. Ok, let’s do that.

PU1500,1500;
CI500;

Nice, right? First we moved to the center of the box, which is (1500,1500) and then we drew a circle with a radius of 500. You probably noticed that the circle command is a little more advanced than PU and PD, in that it automatically handled lifting the pen up and down. As I alluded to earlier, there are other commands like that for drawing primitive shapes, e.g. ER for Edge Rectangles (which are rectangles without a fill):

PU2000,2000;
ER1000,1600;

And if you want a rectangle with a fill, use RR:

PU3000,3600;
RR1000,1000;

Now your piece of paper should look roughly like this:

Not a bad start. Hopefully you found this as fun to play around with as I did when I first started playing with plotters. It does get pretty tedious to manually control it via the terminal though, so next step would naturally be to start automating the drawing part a bit. Luckily there are awesome generative art tools out there, like OpenFrameworks and Processing.org. Personally I like using Processing, because it’s a neat self contained package and because of it’s twin: Processing.js. Processing.js means I can play around with a sketch on my iPad using Procoding while on the train, and when I’m ready to draw it I can dump the exact same code into the “real” Processing IDE on my laptop with access to the serial port, OpenCV, etc.

Connecting to Processing

I’m assuming you know the basics of Processing.org (or a similar environment) if you’re reading this. If not, now would be a good time to pick it up. It has never been easier to get started — there’s a huge community and tons of tutorials to support you.

Essentially the workflow is the same as before: You set up a simple serial connection and hand over the drawing part to Processing (or whatever your tool of choice is). One important thing to be aware of is that these plotters have tiny little buffers, so you can’t feed them all the HPGL commands at once. There are two ways of going about that: One is to drip feed them with data, which is slow, but also by far the easiest to implement, the other way is to implement a simple form of flow control by asking the plotter if there’s enough buffer space available before sending it another chunk of data. I’ll cover how to do that later in another article.

Drip feeding is great for just playing around, especially in the beginning since it’s easy to implement. Just add a delay between issuing your drawing commands, so the plotter has time to catch up. Depending on what you draw you might have to experiment a little. If you overflow the buffer your plotter will start behaving weird and it’ll probably try to indicate that an error happened. 9 out of 10 times I’ve had problems, it’s been due to the buffer overflowing. A good delay value to start with would be something like 250–500 ms.

I’ve uploaded a Processing sketch as an example of something that works with the drip feeding method. It’s a recreation of Georg Nees’s “Cubic Disarray” from the late 60’s, and it looks like this if you plot it on an HP 7550A on a sheet of 11x17" paper:

You can find it here: https://github.com/tobiastoft/SymbolicDisarray

I tried to make the code as easy as possible to modify from a visual point of view, one of the things I did was implement a very simple “symbol” feature, where you can define something else than a square to copy and rotate as the plotter progresses down the page. I’ve included a few examples in the code. The different symbols are found in the “Symbol” class which starts around line 105 (I’ll clean up that file soon, I promise).

I also included a quick example of how to use the HPGL “label” (LB) command to add text to a drawing. You’ll find the example around line 49 in SymbolicDisarray.pde. Labels are fun to play around with and it’s fascinating to watch the plotter write each letter — plus the built-in font isn’t too bad either. Here’s what the Lightning Bolt pattern looks like, notice the label at the bottom.

If you’re still with me this far, then first of all: Thanks! I’m not sure I would have been able to concentrate that long myself. Second, if you’re still interested in plotting then please go nuts with the example code — fork it like there’s no tomorrow and don’t forget to share what you make!

Alright, back to 2019: The years after I wrote this brought a lot of really interesting plotter-related products to the market, as well as much better software solutions than what I’m proposing above. I’d highly recommend checking out this Github repo which is probably the most comprehensive collection of plotter related resources I’ve seen, in case you’re interested in learning more.

📝 Read this story later in Journal.

🎨 Wake up every Sunday morning to the week’s most noteworthy stories in The Arts waiting in your inbox. Read the Noteworthy in The Arts newsletter.