CNC plotter style

So, another day, another CNC-post.
today I’m gonna post my “plotter” processing script.
It takes an image and makes lines where the color is black, and nothing for the rest.

To illustrate this I have a picture of Frank from Donnie Darko.

Scary as always 🙂 After a lite “shopping” he looks like this:
much easier for the processing script to make lines of. Speaking of witch, this is the preview from my processing script:

Here is the script: CNC_Plotter.pde in case you want to generate your own gcode to run on your own CNC machine. Awesome right.

Yes, this post is very similar to

Anyways here is the final result. Made with an engraver bit on plywood I’m not going deep enough to get to the next layer. No inception style stuff here at all!

Here is the output, minus lacquer and with a Swedish 1 krona for size reference!

How to make a drill’ed light-through piece of art.

So, today I’m gonna show you how I use my CNC for more then making it.

First we need a motif.
I searched the internets for a picture of something pretty or cool, then I stumbled upon this image of Scarlett Johansson.
Then you need to pre-process it a bit, I removed all the things that where not Scarlet, then used the threshold function go get it black and white and finally I cut it out all the white that I didnt really need.

Cutting out that stuff also makes it easier to align and size up whatever I’m going to drill in. Now it’s time to use a processing script I originally wrote to generate svg-codes. It now generates gcodes (aswell as an image). One thing to remember is that you need to be careful of whatever size you’re drillbit is, it’s easy to get exited and start to soon. A bit of calm thinking and checking the spacing between the holes is needed.

fx: between  Y6.0, X44.4 and  Y6.0, X45.6 is 1.2mm difference. that is fine if you have like, half a mm sized drillbit. I don’t want that small so I’m tweaking the processing script. This particular time it came down to 2878 holes.

This is how the preview looks:

Right now the CNC is drilling holes in a piece of paper that I’m gonna put into a frame I bought at IKEA. I’ve noticed that It sometimes get’s a bit stupid and tries to take the shortest way to a point that I have not told it to go to. Guess I have to remake more of the source, or perhaps rewrite it. I never use the circle part anyway’s. perhaps a bezier addition could be nice? anyway’s here is a little video of the machine drilling away, not very interesting to watch.

Of course I managed to move the paper around when I should not, crap. And I’ve noticed that the spindle sometimes takes the closes way to a point I haven’t even specified. Guess I have to take a look at that arduino code again. But I’ll wait until I get a laser up and running!

As you can see from this final photo I had to stop it since it started to tear things apart. I really got to fix that bug. So I wont put light’s behind either. I’ll probably throw it away soon. But still It’s good to document things once in a while!

Finally here’s the processing source: CNC_Director

My CNC controller software.

Of course I needed a little program to send gcodes to my arduino that controles the engines.

That was pretty simple since I already had serial connection code up and running.

this is how it looks:

the -X and X moves 1cm to the left and right. the small x’s move a mm. The y’s and the z’s move in other direction.

Connect connects to the arduino, disconnect does the opposite.

set home set’s the home position, the start position of a program, go home travels to that position

start and stop starts and stops the program that is written on the left, the right outputs status information.

The icon was found on 4chan.

Here is the source if you’re interested: CNC_kontroller

Another CNC post

I know these post are getting norm here, especialy the tecnology part of it. Soon though I’ll post a video of the CNC making something.

But this post is about the arduino code I modified to controll the motors. I was going to try more then the reprap old old old gcode interpreter, but I never got further. It’s really booring to configure motor drivers.

Anyways, reprap has a gcode interpreter, I dont really remember all the problems or the modifications that I made. but here are some:

The motors and turnstep had to be configured for the V90.
Inverted angles are the best angles.
Feed speed did not work dunno why, something with the motors.
Turning the motors of did not work, or rather, turning them on again failed.
I removed all endstop triggers, did not connect those.
Fixed the existing feedrate, and added my own 🙂
Added more comment ignore-code.

That’s about it I guess.