Archive for the 'Uncategorized' Category

#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.

#Inktober Project 2019 – Post 4


I intend to replace the stock controller board with an Grbl_ESP32 version. Here is an picture of the existing controller.

Power Input

The power input to my board will be 5VDC. I will not need any power conversion on my PCB, because everything runs off 5V. Measurements suggest I will only need about 2A.

Stepper motors

The stepper motors are unipolar 5 wire motors. I have been testing with a ULN2003 (darlington array) board I got with some motors a while ago.

This worked fine, so I will be using the SMT version of the IC in my controller.

Pen Up/Down Solenoid Driver

A solenoid coil is used with a small magnet mounted to a bar that controls the position of the currently selected pen. Sending the current one way attracts the magnet and sending the current the other way repels it. That controls the up/down state of the pen. I thought a simple DC motor driver would be a good way to control it.

The solenoid runs at 5V and draws about 0.8A of current. I found a nice little motor driver at Pololu that works great. I use one pin to set the direction and the other is used for PWM. I can do an initial full current pull on the solenoid, then switch to a much lower hold current. This prevents overheating of the solenoid.

I decided it was easiest to just put a socket on my controller for the Pololu board, since I already bought a few of them for testing.

SD Card

One of my favorite features of Grbl_ESP32 is the SD card support. That, paired with the WebUI (Web User Interface) is a great way to run gcode. You can upload gcode via WiFi and simply click “play” in the WebUI.

I put a micro SD socket on the board that is accessible though one of the connector holes in the back of the chassis.


The standard USB serial connection of Grbl_ESP32 will also be accessible through one of the connector holes in the chassis

ESP32 Controller PCB

The design is done. I just need to order some. China is on a national holiday, so that will add a few days to the delivery. Here is a screen shot of the design.

The PCB is way bigger than it needs to be. I wanted it to use the same mounting holes, have the same connector locations.

Here is a link to the schematic.

Inktober Project 2019 – Post 3

Setbacks and Homing Issues

Status Update

Read Post #1 and Post #2 here

I have a breadboard version of the controller running. So far, it can control the motion of the pen, feed roller and check the homing (reed switch).

Broken Gears.

I noticed a little clicking sound and rough motion when running the motors. Looking carefully, I could see that the gears on the motor shafts were both cracked.

After searching around, I found that this is a common problem. The gear is pressed on and 35 years of stress probably cracked it. Fortunately someone sells them via Shapeways On Demand printing service.


At startup, the machine needs to home the X axis and locate pen #1. It does this in a clever way, so that it does not require any motors or sensors on the pen carriage.

The pen carriage has a little bar magnet. This will only trigger the reed switch in one orientation of the rotating pen carriage. Each time the carriage goes to the left end a little metal tab pushes the carriage 12th of a rotation.

As far as I can tell, on the first move, it moves to the left the full width of the X travel. If the carriage started in the middle of travel, the motor just stalls for the rest of the move. It then checks the reed switch. If the switch is not activated, it backs off to the right, comes back, rotating the carriage another 12th turn. It checks the switch and repeats the sequence until the magnet is detected.

Here is a video of that.

Grbl Homing

A standard Grbl homing sequence is not going to work. It will go to the end, not see the switch and fail. I will need to program this multi-move, check, repeat sequence into Grbl.

#Inktober 2019 Project – Post 2

Reverse Engineering the Atari 1020

The field service manual is quite helpful, but the pin numbers of the connectors are not labeled and there are no part number.

Between the manual and some measurements with my meter, I think I have it figured out.

Power Supply.

I do not have the original external (wall wart) power supply. You can tell it is AC from the schematic. I did some research and found out it is 9VAC. That goes through (2) 5V volt linear regulators (with a huge heatsink). One powers the stepper motors and all the logic. The other powers the pen up/down solenoid.

Basically, I should be able to power everything with a robust 5VDC power supply. I’ll probably use this style.

Switch Panel

This connects via a 6 pin molex SPOX 10013066 connector. The PCB side is Molex p/n 10321061. The power switch is a latching switch that connects the incoming 9VAC voltage.

The function switches are normally open, momentary switches that close to ground.

Here is the pinout of that cable.

Pin #DescriptionWire color
2Pen Change SwBlue
3Paper Feed SwPink
4pen Change SwYellow
5Power (in)Red
6Power (out)Red

Pen Solenoid

Then pen moves to and away from the paper using a solenoid. The schematic is amazingly complex here, but basically the voltage flows one way through it for pen up and the for pen down. It is a 5V coil with a resistance of 5.2 Ohm.

Stepper motors

There are (2) stepper motors. One is for the paper feed and the other moves the pen carriage. These motors are 5 wire unipolar motors. These are typically used by connecting the common to voltage+ and the other wires to transistors. If sequenced on one at a time, you get 4 independent coils.

The coil resistance of the paper feed stepper coils is 50 Ohm and the carriage is 60 Ohm.

Pen Change, Homing switch

There is a reed switch activated by a magnet in the pen carriage.

Printer Mechanism Cable

There is a 13 pin cable that connects everything in the plotter mechanism to the controller PCB. This uses a Molex connector p/n 511911300. The mate on the PCB is Molex p/n 22041131. The pinout is here.

Pin #DescriptionColor
1Reed SwBlack
2Reed SwOrange
3Carriage Stepper #1White/Red
4Carriage Stepper #2Pink
5Carriage Stepper #3Blue
6Carriage Stepper #4Red
8Feed Stepper #1Purple
9Feed Stepper #2White/Blue
10Feed Stepper #3Yellow
11Feed Stepper #4Brown
12Pen SolenoidGray
13Pen SolenoidLight Blue

#Inktober 2019 Project – Post 1

#Inktober is a hashtag I have seen popping up over the past few years. Inktober was apparently started in 2009 to encourage people to do an ink drawing everyday in October. The #plottertwitter generative art community has joined in recently.

I am not much of a hand drawing person or even a generative art person, but I do like to make drawing machines. I decided to use Inktober to work on a new plotter. I am getting a little head start, so I can actually do some plotting in October.

Atari 1020

I decided to try to convert an old Atari 1020 plotter to use Grbl_ESP32 as the controller. It would give the plotter Bluetooth and Wifi support and use gcode to plot. I could talk to the existing controller via the Atari 1020 serial protocol or I could completely replace the controller with the ESP32.

I decided it would be more fun, challenging and great opportunity to learn some things by replacing the controller. I set the following goals.

  • Do no harm. I want to avoid damaging any parts. Cut no plastic and cut no wires.
  • Change only the controller. I will use the existing, unmodified switches, stepper motors, etc.
  • Clean implementation. Try to make it look original. Use the existing mounting holes. Use existing holes for connectors, etc.

About the Atari 1020

The Atari 1020 was sold in the early to mid 1980’s. It was designed by ALPS Electric. It uses the same ALPS DPG1302 mechanism as the Commodore 1520, Tandy CGP-115, Sharp CE-150, Atari 1020, Mattel Aquarius 4615 and Texas Instruments HX-1000

Useful Links

MPCNC Grbl_ESP32 Controller

Thank you to all the people who gave me feedback. The design of the prototype is done and is on order. Here are the choices I made in the design

ESP32 Controller

The board will use the 2×19 pin style controllers. It will support the (2) common pin widths of 0.9″ and 1.0″.

Power Input

The voltage range is 12VDC to 24VDC. The power input will be via a (2) pin, 5mm pitch, screw terminal block. I decide to not use a barrel jack or Molex style connector, because these are primarily 12V types and many people will choose to use 24V.

Stepper Motor Drivers

I decided to support simple Pololu/StepStick style plug-in modules. I decided to not support SPI controlled versions like the TMC2130. These required significantly more I/O. I did not want to add external I/O expanders.

There are 5 stepper motor driver sockets. (2) each for X and Y and (1) for the Z. The (2) X drivers have separate step control pins, so the firmware can perform a squaring function at the time you home the machine. The same is true for the Y axis. This is optional, these axes can also be ganged together. All motors wire the same. The controller takes can of reversing the direction of the second motor and X and Y

Limit Switches

There are (2) connectors for limit switches on the X and Y axes. (2) switches are required for the squaring function. These switches are wired in parallel and use a single I/O pin. The extra connector is just for ease of wiring. If you like you can wire them in parallel off the controller. Limit switches can also be added at the other ends of travel if you like. All switches must be normally open (close when limit is reached)

Squaring uses the motors to pull the gantries square with the rest of the machine. Squaring is performed when the machine is homed. The axis moves towards the lower end of travel with both motors until it hits either switch. It then backs off the switch. It does not know which switch hit because they are wired to the same I/O pin, so it now homes each side independently. The location of the switches sets the squareness. As long as the motors stay energized, it will stay square.

Spindle / Laser

The basic spindle feature is a relay to turn on and off AC and DC spindles. It can handle 120VAC – 240VAC 10A and up to 30VDC at 10A.

There is also a 5V PWM function than can be used for laser power control and PWM controlled variable speed spindles. There is a safety interlock for this which would typically be used by a laser. (2)s pin need to be connected together, typically through a switch in order for the device to be connected to the PWM signal.

Control Switches

Grbl has the ability to do a nearly immediate feedhold without loss of position. It will decelerate the machine as soon as you click the button, even in the middle of a gcode command and if the buffer is full of moves. You can then click start to resume the job. If you want to cancel the job without any loss of position, you click the Grbl Reset button. This clears out any remaining things in the buffer.

All these functions are available of the serial, WiFi, etc, but sometimes it is nice to have a dedicated button when you need a quick stop.

5V Fan Power Output

There is a (2) pin header connector that can be used to add a cooling fan. A fan can allow the steppers to output more current and should also be used if the controller is mounted in an enclosure.

Project Status

The boards are on order. I expected to have testing and firmware changes done by the end of the month (March 2019). I will sell a few prototypes on Tindie, while working on getting a larger quantity built.

I will release all my source files as soon as testing is complete and the design is verified. Here is the current schematic.


  • Can this be used as a (5) axis controller? No, the extra X and Y axis stepper drivers use the same direction pin as their paired motor. They have separate step pins. Note: Grbl_ESP can be extended more axes, but not with this controller.

MPCNC ESP32 Controller Ideas

I have been thinking about designing a custom Grbl_ESP32 controller for the MPCNC (Mostly Printed CNC ) machine. The MPCNC is a simple and low cost CNC machine. The MPCNC is primarily used as a router, but many people often use it for laser cutting and engraving. A custom controller would address the design features of the MPCNC, make it very easy to hook up and the ESP32 would add Wifi, Bluetooth and higher speeds.

The goal would be to create a low cost, open source controller. It would directly address the needs of the MPCNC, but avoid expensive additional add-ons.


It will use the low cost plug in ESP32 development modules. It will support the 2×19 pin types only, with both 0.9″ wide and 1.00″ wide types supported.

Power Input

I think most people would use 12V, but I’ll size the parts so 24V can also be used. I think a 2 position 5mm terminal block is best. It can handle higher currents than a DC barrel connector.

There will be a small 5V 3A DC-DC power supply on the controller. This will power the MCU when not connected via USB. It will also power a few other things. You will be able to communicate with the MCU via USB power, but most other stuff on the board will not work without the primary 12V power.


  • USB: This will use the micro USB connection on the ESP32 module. In this mode you can use just about any gcode sender that supports Grbl
  • WiFi: You can stream gcode over Telnet. You can also use the WebUI to control the machine, upload to the SD card, run and monitor jobs.
  • Bluetooth Serial: This is a Bluetooth mode that presents itself as a serial port on connected devices. There are a lot of senders that support this.
  • SD Card: Running jobs from an SD card is my favorite feature of Grbl_ESP32. When used with the WebUI, you can’t beat it. Also, we may be adding web browser “plugins” that would load pages from the SD card. This could be gcode visualizes and gcode generators.

Stepper Motor Drivers

The MPCNC uses (2) stepper motors each for the X and Y and (1) motor for the Z, for a total of (5) stepper motors. Ganging (2) motors for an axis can be done with (1) driver or (2) drivers. It think it is probably best to use (2) drivers each for the X and Y axes.

I think it is best to use the standard Pololu footprint drivers to simplify things and lower cost, I would hardwire all microstep selection pins to the highest setting. The Grbl_ESP32 can still run crazy fast at high resolutions. I don’t think it is worth supporting drivers with firmware control of current, microstepping and other features. The firmware does not yet support these anyway.

Spindle / Laser Control

I think most people use an AC router for these machines. That means an on board relay is probably the best way to control that. I will also provide a 5v PWM signal on a header connector, for those who want to try controlling the speed.

The laser will also use the PWM for power control. I am worried about people accidentally PWM’ing the relay circuit, so I will use separate I/O pins for the relay and the PWM. That would also allow the relay to be used for other functions when using PWM.

I/O Inputs

  • Limit Switches: X, Y and Z limits switches. These can be used as simple homing switches. The firmware also supports putting both max and min limit switches on each axis.
  • Control Switches: Feedhold, Cycle Start and Grbl Reset (end job, without position loss).
  • Touch Probe: This can be used to zero your bit on the work.

All input pins will have low pass filters on them to improve noise immunity. Optocouplers have been considered, but are probably overkill and technically require an extra, isolated power supply.

Update: In the comments, Drew mentions auto-squaring would be a big improvement for the MPCNC. Is it worth giving up an spare I/O (requires 2 extra pins)

Extra I/O

There will probably be a few extra I/O pins. These will be brought out to a header connector and can be used to add your own features.

Mounting / Enclosure

I am not quite sure about the shape and mounting right now. It will probably be rectangular due to (5) drivers along one edge. I’ll put mounting holes in the corners. I’ll add a connector for a small fan. You probably only need the fan if an enclosure is used. I would love some feedback here.

Question #1: What is more important, small size or detailed, easy to read labeling of the pins?

Probably Not Included

  • Local Display (LCD, OLED, etc.): Local displays have been avoided on the Grbl_ESP32 project. The connectivity options eliminate the need for this. A smartphone is a much better interface that allows you to get status, control jobs, upload jobs, act as a pendant, etc.
  • Vacuum, Coolant Relays: These are expensive and take up a lot of board space. There are a few extra I/O pins that will be brought out to connector if you want to add these features.


Please add comments if you think I should change anything or consider some other features.

Update: 3/4/2019

A schematic and layout are now done. I probably wait to order it, so it arrives about the same time I get back from a vacation 3/18/2019.

Using Large Motor Drivers with 3.3v Micro Controllers

Pololu and StepStick style stepper motor driver modules are great, but they have limited power. If you want more power, you will need to use larger stepper motor drivers like the one shown above. While the small modules are limited to about 2A. I have seen these stand alone drivers deliver close to 10A.

They often use opto-isolators on the inputs. Opto-isolators are used to block noise and spikes. Large machines with high currents can cause a lot of electrical noise. This noise can damage sensitive electronics and cause false triggers on switches or even false steps on drivers.

via Wikipedia

Opto-isolators use a non conductive gap. The signal crosses the gap using the light of an LED and an optical receiver. No noise, signals or spikes can cross the other way.

The LEDs have a forward voltage spec. You need to size a resistor to the voltage of your signal. The stepper drivers typically have a resistor built in for a 5V signal. They show that resistor in the simplified schematic on the case.

You can use a larger voltage by adding another resistor in series with their resistor. The operating manual will tell you how to size that resistor. Unfortunately, you cannot use a lower voltage.

Here is a simple circuit I have used to get around this. Just about any NPN transistor should work because the current required by the LEDs is typically less than 15mA.

Polar Coaster Version 2

I recently decided to update the Polar Coaster project. The primary reason was to update the controller to use Grbl_ESP32 firmware. I also thought I could make it smaller, lighter and remove a little cost.


The old controller was not custom made and just sort of tacked onto the back. This increased the size and didn’t look very good. It had a Bluetooth module, but you still had to stream the gcode. You could use an Android app, but that was still a little awkward.


The controller runs Grbl_ESP32. This was recently updated to include pen machine features. This allows precise control and calibration of the pen servo. You can control the speed, timing and endpoints of the servo travel.



The controller has a web server that serves a web app. This allows complete control of the machine. Web browser based control is ideal, because it is compatible with anything that can use a browser.  We hope to add additional web apps for generating gcode from images and SVGs.

SD Card

This is a great feature. If you have files on the SD card, they can easily be plotted. The WebUI lets you upload files and then click play.

Stepper motors

Both versions use NEMA 14 motors. The original version used 34mm deep motors. I used these because I had some. They are overkill, because there is very little load on the motors. I bought some 20mm deep motors for the new version. These are even a little overkill. I am only running about 0.3A of current into each one. There are not too many options for standard stepper motors that are smaller and lower cost than these.

Gear Driven Rotational Axis

I decided to change from a belt driven rational axis to a gear driven one. Loop belts are a pain, because you have to order them from expensive places like SDP-SI and if you want to tweak anything, you might need to order a different size. I decided to use helix gears this time. These are 15° gears with a modulus of 1. They print and work great with my printer, even on a coarse layer height. The motor is mounted on slots and it is easy to get virtually no backlash. The helix keeps them quiet.

Rotational Platter

The platter rotates around a central bearing. This pulls (3) smaller bearings, that act like wheels, into contact with the PCB. This causes the platter to stay very flat, without wobble. I created a copper ring, plated with solder on the PCB to make it extra smooth and wear resistant. It also looks really cool and shiny on the PCB!


Since there was a little room left on he board, I added three buttons. I have not added anything to the firmware yet. I think one will definitely be a homing button. I am not sure what to use the others for. I thought it might be handy to have a repeat button to repeat the last plot without having to fire up the phone app.

Battery Power

I made a battery case in the base of the machine to hold an RC style LiPo battery. I am using a 3 cell (11.1V) 2200 mah battery. The idle current on the machine with the WiFi running is about 80ma. When plotting it peaks at about 800ma. I think I should get about 2 hours of continuous plotting.


  • Put kinematics into the firmware. currently files need to be pre-processed with the python script.

If you want to be notified of future blog posts, please subscribe.


New 2.5D Pen/Laser ESP32 Controller

I have done several pen and laser machines lately, so I decided to create a custom PCB for Grbl_ESP32 for these types of machines. This is a small (70mm x 60mm) PCB with all the features a pen plotter or laser cutter/engraver would need.

These typically use stepper motors for the X and Y axes. On pen plotters, the Z axis is controlled by a servo or solenoid. On lasers you need an accurate PWM for laser power control.

Here are the features of the PCB assembly

  • (2) Stepper Motor Driver Sockets for standard stepper driver modules.
  • (1) Hobby Servo Connector.
  • (1) High Current (10A max) Output Control. This can be used for a solenoid, fans, etc.
  • (2) limit/Home Switch Connectors.
  • Laser Power PWM connector
  • Removable Micro SD card. Upload files via Wifi to reliably run off-line.
  • 5V 3A Step Down Power Supply
  • Standard DC Barrel Connector for power input. (9-28 VDC)
  • Power Output Connection for laser module.

Grbl_ESP32 Advanced Features

  • 32-Bit dual core processor
  • Fast 120kHz step rates
  • WiFi
    • Access point or station modes
    • Complete web user interface
    • Telnet
  • Bluetooth Serial
    • Compatible with phone apps
    • Compatible with most serial port gcode senders
  • 16 bit laser power control.
  • Core XY kinematics supported for T style machines.
  • RTOS (real time operating system) allows the use of custom tasks.
    • Precise servo control accurately mapped to Z motion, plus interactive calibration.
    • Precise control of solenoids via adjustable pull and hold strengths using PWM. This allows a strong pull, yet a cool hold temperature.
  • Instant On/Off – Unlike a Raspberry Pi, there is no long boot time or formal shutdown required. It is typically ready to go in a few seconds.

How to control it

There are several ways to connect to the controller, but to run jobs, you basically either stream the gcode or run it from a file on the SD card. The SD card is a great feature because it is free from connectivity interruptions and you don’t need to stay connected to your machine while it is running the job. You can quickly upload files via WiFi or remove it and plug it into your computer.

Serial port

This controller is compatible with virtually all of the serial port gcode senders for Grbl. The default baud rate is 115200.

Bluetooth Serial

This is a great way to use your phone to control a machine. When you connect via bluetooth, your phone or computer will create a virtual serial port. This means you can then use existing serial port based gcode senders.

Wifi – WebUI

The controller has a web server. The controller can create its own WiFi access point or connect to an existing WiFi network. You connect to the controller with a web browser and it serves a full featured machine controller to browser.

Controlling the Pen Up/Down Servo

The servo is controlled using a separate RTOS task on the controller. Grbl thinks it is running a normal stepper motor on the Z axis. Each time the servo task runs, it looks at the current position of the Z. It then computes and sets a position for the servo. You map the servo’s range to a Z range.  For example the range could be set for 0-5mm. Any values of Z above or below this range would would be limited by the range, so any Z value above 5mm in this example would not move the servo past where it was at 5mm.

You can calibrate the end points of the servo to fine tune it. We use the Z axis resolution and max travel settings to do this. $102=100 (100%) would be no change to the first end point. %102=90 or $120=110 would be 10% changes in either direction. $132 works the same way for the other end point. Make sure you do not adjust the servo so it hits the physical end point of its travel. You will feel the servo continuously vibrating as it pushes against the end point. This is very hard on a servo and will overheat and damage it.

The servo updates its position 20 times per second. Therefore it will do a good job of respecting the acceleration and speed settings in the gcode.

The feature also uses the $1 (Step idle delay) setting. It the steppers motors disable, so will the servo and can be moved manually.

Additional parts you need

The controller uses plug in modules for the the ESP32 controller and the stepper motor drivers.

ESP32 Controller

The ESP32 controller needs to be a ESP32 Dev Module. It should have 2 rows of 19 pins. The rows should be spaced 0.9 inch (22.86mm) apart. Be careful: Some similar controllers have a wider pitch.

Stepper Motor Drivers

The drivers are the standard StepStick (Pololu) style footprint. The (3) microstepping selection pins (MS1, MS2, MS3) are all connected to logic high. This typically results in the highest resolution (1/16 or 1/32). The Grbl_ESP32 step rates are high enough  to make that not an issue. I typically use TI DRV 8825 or Allego A4988 modules, but others can be used as long as the pins are compatible. The PCB silkscreen has the corner pins labeled. Use them to insure you correctly install your driver modules.

Source Files (coming soon)

A completely assembled PCB is available on Tindie. The profits from Tindie help me to continue to develop the hardware and firmware for projects like this. If you want to roll your own, the source files are linked below.


Suggestion / Changes?

If you have any suggestions or need a custom design please contact me.

If you want to be notified of future blog posts, please subscribe.