#Inktober Project 2019 – Post 5


My Atari 1020 Pen Plotter retrofit project is done. My project for the month of October (#inktober) was to convert a 35 year old Atari 1020 to Grbl_ESP32 control. My goal was to not change, modify or add any parts other than the controller.

Atari 1020 Overview

The Atari 1020 is a tiny pen plotter. It is based on an ALPS mechanism. That same mechanism is used on several other plotters, including the Commodore 1520.

It plots on 115mm wide paper from a roll using 4 tiny ball point pens. It uses a pistol revolver type mechanism to change the pens. It sold for about $299 in the mid 1980’s

It connects to the host computer via an Atari SIO (Serial Input/Ouput) connector.

Grbl_ESP32 Advantages

  • Plot from standard Gcode
  • Standard USB/Serial port
  • WiFi
  • Bluetooth
  • Web Server with UI
  • Print from SD Card

I knew Grbl_ESP32 was far from being ready for this out of the box. This challenge would force me to learn a lot of new things and add new features to Grbl_ESP32. Here is a list of things I had to do.

  • Add unipolar stepper motor support
  • Add custom homing sequence support.
  • Add M6 tool (pen) changing support
  • Add solenoid support, with reversible voltage and current control
  • Add support for M30 (end of job) command.
  • Custom button functions

Unipolar Stepper Motors

Unipolar stepper motors are super low cost stepper motors. They often cost less than $1. Unlike the bipolar hybrid stepper motors we see in our 3D printers, these use 5 wires. The 5 wire setup creates 4 coils. All 4 coils have one end as common. These are typically controlled by putting the positive voltage on the common and using transistors on the other 4 wires to switch them to ground in a sequence. One a 4 wire motor, you need to be able to reverse the voltage through the coils at each step. The 5 wire method makes that a lot simpler. You cannot use the Pololu/StepStick style stepper motor drivers unless you cut the connection between coils that the common makes. That violates my goal of no changes.

The Atari 1020 has 2 of these motors. One moves the pen and the other moves the paper feed roller. I used a ULN2003 darlington transistor array for each stepper.

I added the option of using bipolar stepper motors to Grbl_ESP32. It is very simple to use. You just need to tell it to use the unipolar motor feature and define 4 I/O pins for each motor. This is the code you add to your machine definition.


#define X_UNIPOLAR  
#define X_PIN_PHASE_0   GPIO_NUM_13
#define X_PIN_PHASE_1   GPIO_NUM_21
#define X_PIN_PHASE_2   GPIO_NUM_16
#define X_PIN_PHASE_3   GPIO_NUM_22     

#define Y_UNIPOLAR
#define Y_PIN_PHASE_0   GPIO_NUM_25
#define Y_PIN_PHASE_1   GPIO_NUM_27
#define Y_PIN_PHASE_2   GPIO_NUM_26
#define Y_PIN_PHASE_3   GPIO_NUM_32

This definition method allows you to mix unipolar, bipolar and servos on the same machine.

The unipolar feature supports full and half step mode. Half step is the mode I used. This new feature could spawn a bunch of super low cost machines.

Custom Homing Sequence

Normally, when you home an axis in Grbl_ESP32, the axis moves until it detects a limit or home switch. There is no home switch on the Atari 1020. It also also needs to also find pen number 1 during the homing operation.

To do this I added optional custom homing routines to Grbl_ESP32. You add a #define USE_CUSTOM_HOMING to your machine definition. That tells Grbl_ESP32 to skip the normal homing and run a function called void user_defined_homing(). That is a function that is written for the machine.

In the case of the Atari 1020, that function starts a state machine in an RTOS task. That task sort of works like a little gcode sender that takes control of the machine until the homing is complete. There is more on that here.

The feature could be used on any machine that cannot use regular homing or needs to make sure the machine is ready to be homed, etc.

Tool (Pen) Changing

Previously, Grbl_ESP32 only tracked the tool number and ignored the M6 command. Now if you #define USE_TOOL_CHANGE, you add a function void user_tool_change(uint8_t new_tool). Here you would place all the code you need to do a tool change.

On the Atari 1020, it just needs to bump the left side of travel 3 times per pen. If you have pen 1 and need to get pen 3, it bumps the left 6 times.

Solenoid Support

The Atari 1020 uses a solenoid coil and a magnet to control pen up/down movement. If you energize the coil one way, it attracts the magnet and places the current pen on the paper. If you reverse the voltage, it repels the magnet and pulls the pen away from the paper.

I was afraid the coil would get hot, so I wanted to use a PWM to lower the duty after 1 second. It did my testing using a Pololu DRV8838 motor driver. To speed up prototyping, I just plugged that into my controller.

In the image below, the solenoid is where the motor is.

M30 Support

I wanted the pen carriage to return to the right end of travel at the end of each job. There are 2 reasons for this. That is where the pens are removed. The second reason has to do with how the homing works. There is no limit switch, so you have to crash into the left end. If you are close to the left end at the start of the home, the steppers will still try to drive it for a while after it hits the end. The closer you are to the right end when you start, the less step skipping there will be.

Unfortunately, many gcode files don’t have an end of file marker. There is an M30 command for this, but Grbl previously didn’t do anything with it. I added support for custom handling of the M30 command. If you #define USER_M30, you can add a void user_m30() function. For this project, I have it move the carriage to the right.

Button Support

Recently, custom button support was added to Grbl_ESP32. This is a simple way to fire a custom function when a button is pushed. The 1020 has 4 buttons.

The first button is simply a latching power button. I used that the same way. It breaks the incoming 5V.

The next button is labeled “PEN”. I made that a homing button. Normally the 1020 homes at power on, but I wanted a button to do it. That will allow me to home the machine before each job. That will be an easy way to reset the Y axis zero as the paper is ejected after each job.

The next button is labeled “COLOR”. I use that button to change to the next pen and move under the pen eject lever. Normally software controls the pens. This will be an easy way to unload the pens.

The last button is labeled “PAPER”. I use this button to feed out 25mm paper. You push this a few times to the point where you want to tear it off.

The Controller

A controller was designed as a direct, drop in replacement for the original controller. Here is a picture of the before and after.

It is very simple with very few parts. It has the ESP32, the (2) single chip transistor arrays and the Pololu motor (solenoid) driver. The rest of the parts are just connectors and capacitors. I use an external 5VDC power supply, so no additional power handling is needed.

The source files for that controller board are on this Github repo.


The original unit did not come with a power supply, but I think it was a 9VAC wall wart. It was rectified and feed two 5V linear regulators on a giant heatsink. One feed the solenoid and the other did everything else.

I used a 5VDC 2A wall wart. The current appears to peak at about 1.50A,

The Firmware

The firmware is currently a branch called unipolar. The changes will be merged to the master branch soon. If you don’t see the unipolar branch when you read this post, it has probably been merged into master.

GCode Generation

The machine will now run standard gcode that isw compatible with Grbl. I used Carbide Create, because it supports tool numbers. It also adds an M30 to the end.

I created tools with tool numbers 1 through 4. I create a separate tool path for each color with the appropriate tool number. If your CAM program does not support tool numbers, you need to insert M6 Tx to change pens. M6 T2 would change to tool (pen) number 2.

  • Tool 1 = Black
  • Tool 2 = Red
  • Tool 3 = Green
  • Tool 4 = Blue

Pens and Paper Sources

eBay has the pens, but they are quite pricey. I found some cheaper ($6) set s here. Search for “Atari 1020 Color Plotter color pen set” on that page.

I bought the paper rolls on eBay. They were expensive at $18 for (2) rolls, but they fit perfectly and came with an axle. The axle could be a simple rod 6mm dia. x 130mm long. The paper is 115mm (4.5″) wide. I don’t know the length, but the roll is about 50mm in diameter.

Final Thoughts

As I was building this a few thoughts of other ways to do things occured to me….

A single ULN2803 (8 transistors) could have been used instead of two ULN2003 (7 transistors).

It would have been fun to try to make an adapter so the ESP32 plugs right into the existing controller socket. It would use all the existing electronics to driver the motors, etc. That would have taken a lot more reverse engineering, but I am sure I would have learned a lot.

The actual plotter mechanism is really small. It only represents about 1/8 of the volume of the 1020. I could have made a much smaller controller bolted to the bottom of it and 3D printed a case. It would have made a really tiny printer.

I would LOVE to do this on another pen plotter, seismograph, etc. The older and more obscure, the better. So, please send any leads or ideas my way.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks

6 Responses to “#Inktober Project 2019 – Post 5”

  1. Craig Hollabaugh

    Awesome upcycle.

  2. Brian C (WarHawk8080)

    MOST AWESOME!!! So very cool that it lives and prints multiple color…such a great job!

  3. Eliot Mansfield

    Hi – This plotter is also used on the Olivetti PL10 and i’m looking for the replacement pens – do you know where they are available from?


  4. bdring

    I got my pens from this web site for $6 for the set. The site looks like it was designed in 1983 too 🙂

    Search for “Atari 1020 Color Plotter color pen set” on that page.

  5. Douglas

    I would like to buy a controller board. Pens are hard to find but the gears are almost impossible to find. Pulling a good gear off of a bad unit is also a chore but I have salvaged one or two in my day out of thee to four 1020 mech. I just bought a darn near brand new commie printer and i did get one gear out of the 120$ purchase.

  6. bdring

    All of my boards have been sold. There is a Github repo if you want to make your own. I bought my gears from Shapeways. They were $15 for 3 and they worked fine. I also found some “0.25 Modulus Brass Gear” on eBay.