My first attempt at a ground-up robotics control system: teaching a CNC machine to write.
INTRO
This will be the first in a series of posts detailing a project that I spent the better part of three weeks working on: an app to teach my CNC machine to write. In the interest of keeping it short, I’m not going to go into any technical detail in this post, instead focusing on my thoughts throughout the process and my motivations behind it.
When I say “the better part of three weeks,” I mean a majority of my waking hours in that time span. I find projects like this exciting—once you get the initial ideas flowing it hardly ever leaves your thoughts. It was mid-October, and I’d just finished a very rough few weeks of midterms, papers, and jumping through various other academic hoops. I knew I had a down period before my next exams, and I needed something to take my mind off of the stresses of university life. I started to roll a few thoughts around in my head…
THE IDEA
I hadn’t really done much with my machine for the month or so school had been in session. I hate to watch it sit idle on my desk, doing nothing but taking up space and collecting dust. But due to multiple factors, I couldn’t really use it for cutting materials any more.
I toyed around with the idea of converting it into a 3D printer. It would definitely require some work, but all things considered the process of conversion isn’t prohibitively difficult. After some serious consideration, I decided I’d rather preserve its milling capabilities and save 3D printing for another day. Back to the drawing board.
While doing general projects and builds, I generate a pretty substantial paper trail in the form of notebooks, journals, planners, etc. Unfortunately, it can tend to get pretty messy at times. When I’m jotting down ideas and planning out the path ahead I’m usually writing at maximum speed, and while it’s effective and legible in the short term (reading is like 70% context after all), it can be frustrating to revisit old notes and find that they more closely resemble hieroglyphics than English.
My graphic designer side has always wanted to make a custom font. I have this grand idea in my head of what my handwriting should look like, and I always thought it would make a good typeface if it were done correctly.
Then it clicked. I could put my machine to good use cleaning up my records and helping increase the quality of my documentation by turning it into an all-purpose notebook keeping utility. Obviously, the first and largest step in this process is teaching it to write.
THE PROCESS
The idea was to build a ground-up platform to convert ASCII text into an executable CNC toolpath. I’ll save the juicy details and problem solving techniques for future posts, but here’s a basic overview of how it works.
The process starts by importing/inputting a group of settings. Most every important quality of the final writing job is user definable. Everything from letter size to italics shear angle to page formatting is customizable for each individual job. You even have a choice of font family: Serif or Sans.
Once the settings are in place, the next step is defining the output text. The program has an inline text editor for typing on the fly, but it also supports text import from a .txt or other plaintext file. With the text and settings all in order, the next and final user step is to choose an export name and location and let the code get to work.
When running, it jumps through your input text block one line at a time. Within each line, it travels ahead letter by letter, taking the input parameters given earlier and applying them to an array of points that defines that defines each letter, putting together a custom toolpath for that letter and settings. Once the letter is fully assembled, it translates the letter into machine-readable GCode, writes it to the output .tap file, and moves on to the next letter. Repeat as necessary.
In short: You feed it input text and a whole array of settings, which it then parses and exports to a GCode toolpath.
SUMMARY
I’m far from finished talking about this project, but I hope that this serves as a good introduction to the build.
GH
One thought on “BUILD: Machine Writing”