3d Prints of 2D Images [In Progress]
by masoodkamandy in Workshop > 3D Printing
166 Views, 0 Favorites, 0 Comments
3d Prints of 2D Images [In Progress]
[NOTE: This is an ongoing project so I'll be adding to it as I go along.]
The goal of this project is to take 2 dimensional data like an image and output a 3D print.
Build a square with enough thickness to support the image. The image itself will be printed as if it were a screen
Resources:
An Open Source C++ Gcode Generator
A big part of my project was porting Python code that was given to us as a base by Prof. Jennifer Jacobs for gcode generation into C++ and modifying it to suit my needs. Porting it afforded me the opportunity to gain an understanding of gcode that enabled me to make customizations that would ultimately benefit my project.
My repository is open source and available to anyone who would like to use it.
https://github.com/masoodkamandy/IMGtoGCODE
The features I added to this software were:
- Consistent number formatting in line with what Ultimaker Cura creates.
- Centering prints.
- The possibility of variable extrusion rates.
First Print: Failure Is Helpful.
After finishing porting the software and making a few first modifications, I generated gcode that seemed correct enough. I decided to make my first print.
To limit the number of variables, I decided that my IMGtoGCODE would (at least at first) only output a square image that is 128x128mm.
Each image would be output inside of a thick plastic frame to support it. Because making a square seemed like a fairly straightforward process using a for loop, I decided to start with that.
Here's what went wrong and what I learned:
- Fail: The print bed wasn't level. I've found that the Ender 3 Pro requires bed leveling with every single print. I've learned this the hard way twice now.
Iterate: I'll level the bed every time now. - Fail: 1mm between each stroke in a solid is too large. It leaves a gap, which makes the print fragile and not adhere with itself.
Iterate: Move from 1mm to 0.75mm between each line. - Fail: I calculated the print to be centered, but I forgot to add the code that zeros out the coordinate plane at the origin of the print.
Iterate: Make sure to add that code.
Incremental Progress
My frame is slowly coming together. In this print we managed to fix a few different things:
- Fixed/Fail: Print is now not at the bed origin, but at a new [incorrect and not centered] origin.
Iterate: I need to double check my algorithm for centering the print on the bed. - Fixed: Bed is now level and printing well.
- Fail: Even though I decreased the distance between each horizontal stroke to 0.75 mm, the gaps are still there. In fact they seem larger, so I'm going to double check my logic.
Iterate: Check logic and if logic is OK, then go down to 0.5 mm. - Addition: The bed and nozzle aren't turning off, so I'm going to add cool down code to my slicer based on what the Ultimaker Cura does at the end of a print.
One surprise from this process was how hairlike and fine the extruded plastic is when it is taken off of the bed.
Centered But Interfering With Itself
No mistake in the algorithm in regard to the centering. I just initialized the bed at 200x200mm by accident. So good news there.
I was a bit overzealous and went down to a horizontal distance of 0.2 mm between lines and it messed the print up. I also added finishing code to the slicer to 'present' the print and turn off the bed and nozzle.
Better, But Still Not Adhering to the Bed
This time the print looked better. It still did not completely adhere to the bed, but the distance between the plastic rows seemed better. I call that hDistance and it was set to 0.5mm. It's still not close enough, but I think I'm going to try to increase extrusion this time instead of making the distance smaller.
Still Better... Baby Steps...
This is getting to be endless...
I'm still having trouble with the plastic sticking to the bed and I'm determined to fix it.
This print I added an extruder scalar (called extScalar) and set it to 1.1, so whatever the slicer was calculating, we increased it by 10%. I think the increased extrusion was helpful, but it still needs more so I'm going up to 1.25.
In addition, I'm noticing that the print has a higher likelihood of failing at the beginning. The current slicer creates a slight line right at the origin, which doesn't really work for my purposes. I believe that creating two long lines at the beginning of the print across the bed will improve the likelihood of success.
More Pain, and Slight Success...
So this time it the long line proved to make the print more reliable, so that was a success. However the print still failed to adhere to the bed. After doing some research here...
https://all3dp.com/2/pla-not-sticking-to-print-bed...
... I decided to reduce my bed temperature to 70 degrees, as that seems to be the max that they suggest. I'm also going to adjust the z-offset on my printer to see if I can have more success that way.
Additionally, I think the 1.25 scalar on the extrusion rate was still not enough. I'm going to amp it up to 2.0 and see how that affects the print.
Slightly Better...
This baby's taking tiny steps, but they're in the right direction.
I added a zOffset variable to my slicer and made it modifiable in my code. For this move I went from an offset of 0.4mm to 0.2mm. That was clearly an improvement, but the print seems to still have trouble adhering on the inside of the square.
I'm going to go down to 0.1mm and see if that improves anything.
My extrusion rate doesn't seem to be all that affected by my 200% increase, so I'm curious if I've reached some maximum. I'm going to try to increase it to 300% and see what that does for the next print.
A Consistent Weak Point. Solid Boundaries.
This step the breakthrough was that the different lines seem to be finally sticking together. My extrusion is large enough on the right side, but not large enough on the left side. This would seem to indicate that my bed is not level, so I'll perform another bed leveling.
To compensate for small variations, I am still going to increase extrusion to 500% to see where that takes us.
One interesting thing is that the point of weakness on this print seems to consistently be the left-frontmost inner corner. It always seems to come apart toward the end of the print.
Finally: a Square
Whatever points of weakness I had are now gone. I did the bed leveling very tight and then did a few prints that were clearly too close, but instead of recompiling the gcode, I just went in and manually adjusted the zOffset, which is commented in the code for easy access.
We're all set to move on with one caveat: my code accidentally set the temperature to cool down too early, so I need to look into that, but hopefully I'll be able to build on to this model and start making an image!