Pen Plotter
Hardware- 8 Devlogs
- 53 Total hours
A mostly 3D printed pen plotter using stepper motors, an ESP32, servos
A mostly 3D printed pen plotter using stepper motors, an ESP32, servos
I’ve been working on drawing SVGs. The trick here is to combine everything into one single path in inkscape and also approximate curves and ellipses etc to lines. I’ve also fixed a lot of strange bugs, one of which was caused by a timer overflow, which happens after 9 minutes in micropython. This caused a crash, but now it’s fixed. I also updated the acceleration routine, and now it only activates when the pen is up. I’ll start working on version 2 soon which will fix a lot of the precision issues I’ve had with this version, and also be far more capable.
I’ve been working more on the gantry system, and I got my first prototype up and running.
I used steel rods, NEMA 17 stepper motors, and timing belts for this. Other than that it’s almost all 3d printed. I designed a couple of parts badly, mainly forgetting to put a hole into one of the motor parts, so that the shaft wouldn’t fit. Other than that, it worked surprisingly well.
The first few images I drew were of my cat, Onyx, and I used the system I described in a previous devlog where it converts the image into lines. I’ll also need to try canny edge detection, as that would probably work quite well, but I’ll need to work more on the plotter’s software because it can only draw horizontal, vertical, and diagonal lines at the moment. I’ll also work on converting svgs, and also text possibly
I’ve been working on a gantry system. Not sure if I mentioned it on the last devlog, but corexy is very very painful to design.
I scrapped that after a while and started work on a much more basic gantry design. As I’m writing this, the parts for that system are printing, so I’ll update this once I have a basic prototype up and running.
I’ve also been working on canny edge detection for the images, which finds the edges in an image and turns them into contours that I can draw on the machine. I used python opencv and recycled a lot of code from the previous line-based approach.
I’ll try out both using lines and contours for drawing images, and I’ll see which works better. I suspect that the lines will look much better, but I’m certain they’ll take ages to draw.
Both these methods still output my custom p-code language which will be used on the pen plotter
Next up, I’ll assemble the basic prototype and try to get it working. While I’m waiting for the parts to print, which will take about another 3 hours, I’ll look into possibly using sine waves to draw things, and changing the amplitude, and also a method using zig zag lines which have variable spacing
Oh, and I also worked on a bit of hardware, because the new system uses an extra stepper motor I had to wire up 2 motors in series which is way easier than using another driver and more precise also
I’ve been taking a break from cad, and instead working on converting images to toolpaths for the future plotter.
The first method I tried was using lines. For each pixel there is a block 10x10 steps wide, and if the image is very dark in that region, it’ll draw 10 lines in there, if it’s brighter it might only draw 5.
I also developed my own g-code like language called p-code, where there are only a few commands: MOVE X Y, PEN UP/DOWN, HOME, and SPEED (in steps per second). I turned the images into a series of p-code commands.
Since the pen plotter isn’t finished yet (and to be honest won’t be for a while), I made a simple interpreter and displayed the images using a matplotlib LineCollection.
In the future I’ll be exploring other methods of making images display, such as:
For some strange reason, I decided to scrap the old version with the single x axis, and the string drive. Instead, I’m going for a CoreXY system with fancy timing belts. After 10 hours of wrangling with Fusion and trying to get a functional design, I’m starting to slightly regret it, and I almost wish that I just went with a generic gantry system or even a bed slinger
I posted this devlog because I’m up to the 10 hour limit, and I need to post or else my time won’t count. By chance it happens that I’m just about finished the first prototype of the CoreXY system, and just need to wait a couple days until the parts arrive. It uses timing belts and idlers, NEMA 17 stepper motors, and a single SG90 servo motor, plus a bunch of parts I’ll 3D print myself.
I’ve had so many issues with this project:
So next I’ll work on making the first prototype and after that, if it works I’ll take a break from CAD to work on some software for it, and get it to draw things. If it doesn’t work… I guess back to CAD.
Taking lessons from the last devlog, I completely reworked the pulley system at the end. I also fixed the print settings for the spools, but had other issues.
But in the end I managed to achieve an amazing result, which draws dashed lines. It uses a servo motor to move the pen up and down and a stepper using what is sort of a capstan drive, however heavily modified.
For some reason I decided after this to completely redesign the whole thing into a corexy plotter instead, I think it was a terrible decision but let’s see how we do in 10 hours…
One problem I had is that the pen holder is very very wobbly, either I’ll just tighten the tolerances or maybe change it so that the servo is attached directly. Another is the servo mount - as you can see I had to break some of it off to mount the servo as I didn’t account for the wires.
Pen plotter - first devlog.
I had issues with lookout that meant that I lost about 3 hours of recorded time, but now I have very simple prototype. I did a little programming on the esp32, but this was mostly just writing a test program and setting up the environment.
There are a number of issues with the current prototype: one of the holes on the carriage is smaller than the other, the stepper didn’t fit in the holder, the thing attaching the thread to the carriage snapped the thread, the spool at the end was too loose, and the spools had terrible print quality. There are an number of other issues that I’ll just ignore for now, and fix later.