Monday, December 28, 2020

December 2020-Laser Engraving with A Graphing Calculator!

Have you ever needed a way to impress your math teacher with a unique work of art? Are you tired of doing your Calc homework, but still want a way to feel like you are doing math? Do you want to combine all this with your laser engraver? If so, read on!

What we will be making today.

If you're like myself, you've probably once gotten trapped in the endless rabbit hole of making designs with Desmos. This is a popular web-based graphing calculator that is (thankfully) replacing the Ti-Nspire as students' graphing calculator of choice. Compared to the Nspire, not only is Desmos free, but it is sleeker, faster, easier to use, and doesn't feel like it was coded during the same time when my dad was learning Fortran. Along with solving/visualizing equations Desmos can make a lot of cool, aesthetically pleasing designs out of equations:

A design for my Calc BC teacher, made out of equations.

Now, the cool part about designing with a graphing calculator is that every single line/curve/point you plot is represented in, well, a graph. This means that it is fundamentally similar to a vector image, which is the same type of image many laser engravers use (or can be easily converted into a type that works). See my last post if you are unsure about how this exactly works.

Indeed, a Desmos graph can be easily exported to a .svg file, a type that can be imported into Inkscape (a design software) for laser engraving. The documentation on how to do this is a bit shaky, so let's take a look at how I prepared a design for laser engraving a competition entry.

The prompt for the digital art competition was to design a "math sheep".

After designing your work in any web browser that works with Desmos, save it to your account, and open it in Firefox. While in Firefox, install the Greasemonkey extension. Once complete, press the Greasemonkey icon in the top right corner and click "new user script":

You should now be given a screen that looks like this:
Copy and paste this file into the unnamed script and press the save button on the upper left corner. Credit to baz1 on GitHub.
This should work!
Now, when you refresh Desmos, you should see a "Get SVG" button on the top left. Before pressing it to download your .svg, unselect the "Grid", "Arrows", "X-Axis", and "Y-Axis" buttons in settings.
When the .svg is downloaded, know that (with my setup) it WILL NOT AUTOMATICALLY BE RECOGNIZED BY THE COMPUTER AS A .SVG. You can fix this by renaming it as anything with ".svg" to the end of the file's name.
Renaming the file from the default u7skVC33 to u7skVC33.svg

With the bug fixed the file can now be opened with Inkscape:
We're in!
After resizing and a few additional modifications, you should be able to laser engrave what you designed with Desmos!

Some adjusting and engraving later... and it looks great!

Sunday, December 20, 2020

December 2020-Evolution of my Work

It's been a long time since I last made a significant post to this blog. Probably because it's called Adat is Bored and not Adam Has Stuff to do, but now that hazing my finals are over it's no longer the case. I have no more homework, and it's time for another post!

I've been surprised by the high quality artwork I've been able to produce with the laser engraver. When I started my project of converting a broken 3D printer into one, I thought that I would not be able to make anything that aesthetically pleasing because of limitations given by 3D printing. Indeed, I will boldly state that, as much as I love 3D printing, nothing produced by 3D printers is particularly beautiful. 3D printers have a lot of quality problems--the surface of everything they make is uneven and porous, and the plastic is prone to warping and containing many weird scars from being built in layers. Although these issues can technically be fixed with post processing, it's a huge pain and still leaves the print with a crappy McDonald's toy-like aesthetic.

A 3D printed Gromit (from Wallace and Gromit) I made as a Secret Santa present. Design credit to Stevie135 on Thingiverse. Despite being made on a "high quality printer," if you zoom in you can see scars and "layer lines" made from the layers being stacked on top of each other. You can also see scars from the supports being ripped of :(
To sum up my expectations when I started this project: they were not high. I thought all the crappy parts that went into my homebrew engraver would indeed return, well, crappy engravings. However, I've been pleasantly surprised by how wrong I was. Although operating this engraver is much less streamlined compared to others--such as my college's powerful Epilog Fusion Pro--I've been impressed by the quality of art I've been able to produce. Instead of churning out McDonald's toys like it used to when it was a 3D printer, my engraver now produces balsa wood pieces with a really unique aesthetic. I'd describe it as natural, as it's made of wood, but also clean and industrial with the micron-level accuracy of the machine. The dark parts that are engraved contrast beautifully with the rest of the wood piece, and are relaxing to the eye. It's what got me hooked on engraving and making more art: how I can finally make pieces that I find beautiful, and have fun while doing it.
An image engraved of my friend. Designed by scanning a drawing of him, letting Inkscape trace it, and sending it to the engraver.
Experimentation in laser engraving photos of animals by using a computer to trace the photo. ZsaZsa the cat, everyone!
An homage made to an elusive member of the Case Western Reserve University 2024 Discord Server. Arranged in Inkscape with different photos and fonts.
For us university students, this unfortunately does not require any explanation.
After engraving pixel-based photos by simply popping them into my software, having Inkscape's "trace bitmap feature" convert them to vector art, and calling it a day, I got a bit restless. I wanted to have more creative control over things I was making. However, there is an issue with this: I'm not the best artist and struggle with drawing/designing things from my imagination. In other words, I need a pretty good reference image for the art I make.

My first project with laser engraving things I draw was inspired by the #toonme challenge. It's basically when you take a photo of yourself, or others, or anything really, and draw half of it (traditionally as a cartoon) while leaving the other half blank. I traced half a photo of myself for a graphic design class, and had a lot of fun with it.
My first #toonme designed in Procreate.
Over the summer I re-did this project, only with laser engraving half of the photo instead of drawing it:

My #toonme--half laser engraved, of course.
Although I had a lot of fun with the laser engraved #toonme, it had a pretty big issue that does not normally pop up in the graphic design world. That is, issues in image path tracing improperly defining the photos, and therefore not letting me engrave them as intended. In other words, the engraver can only engrave vector art "paths," a series of lines and points mathematically defined in a given plane. When we want to convert between a pixel based image to a vector image, we take the pixel based image and let the computer trace it. Let's take a look at what this means by using Inkscape, a program for vector based graphic design. First, we can draw a simple straight line, or "path," in Inkspace. Because this is a single path, when engraved it will only look like a simple line:
A thick path drawn using the "create paths" feature in Inkscape. It is important to note that this shape has no fill, but a black stroke color.
Next, screenshot the path you just drew, which will automatically convert it from being vector based to pixel-based. Paste the screenshot back into Inkscape, and use the "trace bitmap" feature to convert the screenshot back into a vector image. You can do this by selecting the image, then selecting path<trace bitmap. Default configurations should work.
A screenshot of the line above, pasted back into Inkscape. Trace it by pressing "path" (highlighted in red) then "trace bitmap".
Once this is complete, both of the lines drawn should look identical to each other in Inkscape. In theory, when you laser engrave them, they should also look the same:
Comparing the thick path drawn in Inkscape (left) to the screenshot of it that was traced by Inkscape (right). They look identical!
Let's engrave the exact image above and see what happens:
The two lines and text, engraved.
Uh oh! They look different! Now we can see the issue: when Inkscape traces any line, it will not show it as a single path even when you want it to. It will always define a line as a collection of paths, like in the "line" on the right. Because the engraver will only engrave paths (and doesn't care about their width), it will therefore show what is supposed to be as a single line as an awkward rectangle.

Under closer inspection, we can see how this happened in Inkscape. Select "no fill" for the line on the right (but make sure that "stroke paint" is set to a color) and notice how it's not actually a single path:
Notice how the line on the right is not a line at all--it is made up of a collection of four paths, each of which the engraver will engrave.
This awkward effect is how my self-portrait was messed up. I originally did all the artwork in Procreate--a great app used for pixel-based drawing on an iPad. This means that when you draw anything with the app, it will be made out of pixels. Here's what part of the laser engraved image looked like before it was traced:
The pixel-based Procreate image before engraving
Here's what the same part of the image looked like after it was traced by Inkscape and engraved:
The pixel-based image, but traced and engraved. Notice how the checkerboard flannel pattern does not come out cleanly, since it was traced wrong by Inkscape
It's important to note that not all laser engravers have this issue, however most budget ones and ones made from modified 3D printers/CNCs will. The solution to this issue required me to not trace images in Procreate, but trace them in Inkpad, a different iPad app. Inkpad is similar to procreate except for it uses a vector file format instead of a pixel based file format. Therefore, when using it there is no need for converting the art one traces to a vector format using a computer.

Take a look at an example below for how I trace. Let's start off with the album covers for one of my favorite artists, Jeff Lynne:

From Out Of Nowhere album cover. Source: Consequence of Sound
Then, trace over it by hand with an Apple Pencil in Inkpad. Pay attention to changes in shape and other edges, but (generally) don't engrave changes in color or shadows as they will not show up well in the engraved wood. Also, make sure to lock the source image as its own layer, and trace over in a layer above it. When complete, this is what my work looked like:
The paths I traced (in white) over the original discovery saucer photo.
The image when it was complete!
Once the traced wireframe-like image is in Inkpad, it can be exported to vector files ubiquitously used in laser engraving. Here is what the piece of wood looked like when engraved on my college's Epilog Fusion Pro:
The final product!
I made other pieces using the same method on the laser engraver I built:
This was from when Elon Musk launched his Tesla into space. Source photo taken from the livestream from the car itself.
Another album cover, Plastic Beach by Gorrilaz.
Thanks so much for making it this far! More to come soon with other experimental laser art!

Thursday, December 17, 2020

December 2020-I'm Back!

You heard it! Time for some updates: when I last posted I finished with converting a 3D printer to a relatively conventional laser engraver, and had plans to turn it into an Etch-A-Sketch laser engraver. That is, you could control the engraver with knobs like you would an Etch-A-Sketch. It was completed! Although this second transformation was a bit of a pain--the rotary encoders in the Raspberry Pi were unstable and the low wattage of the laser module I used required it to move realllllllllly slow, it was still a lot of fun. See below for some of my work engraved in "Etch-A-Sketch" mode instead of being engraved using computer-generated commands (which is more conventional):

My most successful piece with the Etch-A-Sketch laser engraver. It says "Hippo" with a picture of a Hippo I tried to sketch on a hard book cover. It looks like a cow from Minecraft.

After a long night of debugging, I engraved "Overrated" into a piece of balsa wood.

When I get around to it, I will publish the source code in python for the Etch-A-Sketch laser engraver. I'll also probably post a demo to YouTube. I don't think there is that big of a rush to do this as my exact type of setup is already a bit obsolete, with some of the necessary modifications made on my 3D printer not being around anymore.

The two rotary encoders that let the user control the engraver like an Etch-A-Sketch. 

Despite my struggles with unconventional modifications, I highly recommend turning any broken 3D printer into a laser engraver. Because (in my opinion) the most likely part to break in a printer is the extruder (the part that spits out plastic), the printer may not have control over the necessary and complicated instrumentation, heating equipment, or motors for printing. However, In a laser engraver these parts are irrelevant. All you need is a functioning cooling fan port in the motherboard (where the laser gets its power from), a functioning motor that controls the position of the extruder, and you should be good to go! It is a great way to give an otherwise broken machine a second life. Laser modules that can be attached to the printer are very cheap off Banggood, if you get one of them with a quality pair of safety glasses it can be a lot of fun!

Expect a much longer post in the very near future about some of the other work I've done with the engraver over my summer break and since I returned home. Thanks for making it this far!

Monday, May 18, 2020

Days 3-5: My laser works!


My first (successful) engrave!

The past few days of working on the Etch-A-Sketch laser engraver were extremely long. I'm running a bit behind on my original schedule, however this is perfectly OK as I was already planning on finishing well before this project was due.

I don't wish to bore you with the details of how I spend days 3-5: staring at the computer screen, spending hours trying to figure out why something didn't work. I will instead describe all of my major exciting steps taken during this time, and show the rest of my process from turning the barely functional 3D printer into a mostly functional laser engraver.

I ended day two focusing on building the mount for the laser and bed level probe (calculates the proper distance that it should go in the Z (up/down) direction). The first two designs I built for the mount were not functional due to flaws I overlooked, however the third one works great! Once this project is done, I will try to release the .stl (3D) files in a way that properly gives credit to the original creator.

The 3D printed mount for the laser and probe.

After everything was set up, the next step was to wire the laser to the power supply and motherboard. The power supply's job is to convert the alternating current from the wall to direct current (which most appliances run on). It also drops the voltage from 120V to 24V, in this case. The motherboard is the brains of the laser cutter--it uses power from the power supply to interpret all commands by the user, move the motors, and send feedback is something is wrong.

The first part of wiring was a bit stressful, but extremely fun: I gutted the 3D printer! it no longer needs many of its original components, and ripping them out was satisfying. I took out the power cords going to the extruder (part that spits out plastic), and the heated bed. It also no longer needs the thermistors (digital thermometers to measure parts of the 3D printer that are now useless).

The engraver home screen without thermistors plugged in. Apparently it's -14 degrees!

Because 3D printers need very specific cooling abilities--they not only have to safely melt the filament at extremely hot temperatures without damaging the heat end's surroundings, but also need to properly cool filament as it hardens--they always contain multiple fans that the motherboard can carefully control. The input for controlling fan speed is the exact same for controlling laser intensity, and theoretically one could swap out the connector to the fan for the connector to the laser to successfully engrave. However, for my purposes this was a lot more complicated. The original 3D printer runs in 24 volts, and the laser I purchased runs on 12V. This means that if I plugged the laser into the motherboard's fan port, bad things could happen. I'm not sure about the specifics, but the Wikipedia page for Overvoltage seems pretty intimidating...

To make the 12V laser run on 24V, I had to use a buck converter--which steps down voltage in a certain direction. I used this video and a pretty fancy buck converter to do this. Because I'm not the best at it, I used my brother, Jared "Sausage Fingers" Goodman to help with soldering in the final stages of wiring.

Sausage Fingers Goodman

Once wiring was done, it was time to fire up the laser engraver! After running some more tests and re-calibrating to make sure nothing was broken or would unintentionally catch on fire, I recorded the Z height I was using and focused the laser on a thin piece of balsa wood. It's important to record the Z height the laser is at before focusing it as it can become out of focus at different heights (more on this in a later post).


Turning on the laser for the first time!

After that, I used Inkscape and Jon Schone's video to generate gcode (special manufacturing commands) so the engraver could make a design. Although I could rant about the problems I encountered with this software in an entire separate blog post, it would make me instantly reach the maximum space on my Google account. I won't release official tips for using Inkscape until I have a more in-depth chance to mess around with the software and engraver. I'm still learning, after all!

Here are the inital designs I have made with the laser engraver! Super happy with how everything is turning out, even though there are still a few kinks--I'm trying to find the best way to calibrate the engraver so everything is straight and centered, and to also send gcode commands that create an arc in the desired path traveled. Right now, the firmware is not accepting gcode commands for arcs (hence why all the details in the designs below are straight or diagonal lines). This is an extremely weird bug that will require more research to solve.

Victory! The text is a bit crooked relative to the sheet, and I made some progress with fixing this issue on the proceeding designs.
Designed with Illustrator and a tutorial from STE Bradbury Design. Thanks to my graphic design teacher, Danielle "Grandma" Troy for showing me the ropes with Illustrator.

The name for Sausage Fingers' robotics team.


Plans for the near future:

-Finish wiring for the rotary encoder (Etch-A-Sketch knob).
-Write code to hook up the rotary encoder to Octoprint, the software that sends information about where/how to travel to the printer. This will all be done through the Raspberry Pi.

Plans for the distant future:

-Fix the issue with the laser not moving concentrically.
-Find the best method for making sure the wood is always aligned with the X and Y axes.

A fun 5G fact:
-The difference in speed of 5G compared to other network generations is truly insane. It's average speed is 500x faster than 2G's (pre-iPhone, think back when the Motorola Razr and Blackberry used to be cool). It's maximum speed is 10x faster than the latest generation of 4G.

Friday, May 15, 2020

Days 1 and 2--Researching and Setup!

Now that my AP tests are officially over, I have approximately 2 1/2 weeks to build and perfect an Etch-A-Sketch laser engraver. The first part of day one was spent getting my materials organized and determining how I will work on this project. Once I successfully complete everything, I will publish a list of materials and code to anyone who wants to replicate my work.

This project will be completed in five parts, each part representing a certain step in the process of translating the knob movement into laser movement:

1) The user will calibrate the Etch-A-Sketch. This means that they will tell the 3D printer where the corners of their medium is on the print bed, and also set a certain distance in the Z direction (up/down) so the laser is the correct distance from the medium. This will all be done from a Raspberry Pi (think simple, mini-computer) in a terminal. I will probably complete this part last, it will just involve a bunch of coding once everything else is set up.

What the terminal looks like after I wrote some basic programs to re-learn Python. Super simple, but it gets the job done with the lowest chance of failure. I promise that it's way less intimidating than it looks.

2) Using the knobs, the user will send information to the Raspberry Pi. The data in its simplest form will register as either a clockwise turn, counterclockwise turn, or if the knob was clicked.
Rotary encoders--just a highly generic knob used for electronics.

3) The Raspberry Pi will interpret the user generated commands, and compile the information that will be sent to the laser engraver. It will store data regarding the laser's current position and on/off status. It will stop the laser if it is about to crash into the side of the gantry it is suspended on.

The Ender 3 3d printer after being taken out of storage.

4) The information will then be sent to the laser engraver via Octoprint. This is a common software used to manage 3D printers manually from a Raspberry Pi, among other things. The laser engraver will still think it's a functional 3D printer the entire time, and in my research I determined that keeping it tricked and using Octoprint is the easiest way to engrave.

5) The engraver will turn on/off the laser and move!

I am completing the mechanical and electronics (steps two and five) first. Although I tried to order all of my parts in advance, there are always parts that don't work, parts that are the wrong type, and parts that I forgot to get. For step two, the only critical parts are wiring the two rotary encoders to the Raspberry Pi. Step five is a lot more complicated, however. It's basically doing all mechanical modifications to the 3D printer.

Progress with step two:
Today I unpacked my rotary encoders that will serve as the Etch-A-Sketch knobs and the on/off toggle. Before proceeding into the middle and late stages of my project, I wanted to make sure that they would work with my Raspberry Pi. Unfortunately, as I found quick enough, they did not work with the Raspberry Pi. I believe that the type I purchased "without breakout board" is supposed to be used for Arduinos (a data collection device, mostly) and not for the Pi. The picture below shows how the wiring was different from what I needed, I was only able to find decent Pi tutorials for the model "with breakout board." The new rotary encoders will arrive Saturday.


In the meantime, I was able to wire the rotary encoders I purchased to act as a normal button with the Raspberry Pi! I used a simple tutorial for the code, only I switched out the side of the button going to the 3.3 volt input to the "switch" rail in a breadboard. No need to worry about resistors, from what I read this model had them built in. This assumption was correct, I hope.

Turning the rotary encoder into a button.

I'd like to take this moment to thank one of my teachers, Chris "Gramps" Border. Taking his class in Digital Instrumentation last year was extremely useful for step number two, as it covered wiring and programming devices for Arduinos very similar to this. Thank you, Gramps!

Progress with step five:

Step five started with researching the works of YouTuber Jon Schone. Schone is an engineer known for really cool 3D printer mods that are both practical and relatively simplistic. The inspiration for step five, converting the 3D printer into a laser engraver, came from one of his videos where he did exactly that. I downloaded his base and laser module attachment to print and install, however made a few modifications to them:

1) Instead of making the laser easily detachable from the base so it could be replaced with a different module (such as a hot end for actual 3D printing) I fused them together in CAD (3D modeling software). This will make everything more stable, even though the engraver won't be able to get converted back into a printer without taking everything apart. This is OK, however, the hot end already had some issues.

2) IMPORTANT: When I tried to install the 3D printed plastic onto the metal X gantry mount, I encountered an issue where two metal nubs stick out of the piece. Although the design I printed accounted for this by inserting a hole in the plastic that was aligned with these nubs, it was not deep enough and the piece I printed was not flush with the metal. This problem was fixed when I modified the hole to make it bigger in CAD.

Circled in blue, the nubs in the metal (right) and the hole in the 3D printed part

3) Before the 3D printer I'm turning into an engraver broke, I installed and configured an auto bed leveler on it. Long story short, this is basically a probe that the printer uses to accurately calculate how high it is off the bed. I wanted to keep my auto bed leveler on the engraver, and inserted a hole in the 3D printed base that would allow it its cylindrical shape to slide in.

The Auto Bed Leveler, which probes the bed and tells the engraver its position in the up/down direction.


Here's what the final rendering for the part looks like: It's printing right now, and I'll post photos of how it comes out in my next update.

Top view. The lines are an issue with the software, and won't come through in the final product.


Side view, for good measure.


Plans for the near future:

-Finish the laser engraver, or find out which parts I forgot to order and order them. Possibly do a few "test etches" and have some fun!

-Before the rotary encoders come Saturday, review skills in basic Python so I can code better.

Some fun facts about cell phone towers:

No, 5G cell technology does NOT cause cancer, autism, coronavirus, OR ANY OTHER MEDICAL ISSUE!!! Going down this rabbit hole has been one of the most unproductive things I have ever done, and promise to post some cell phone tower facts in the coming days that are more compelling. Just wanted to get all of that crap out of the way, first.