Linux image to laser g code converter

Screenshot-8

I did find imagecarve a GPL V2 open source program. After mapping the Z axis to S spindle values it looks like the g code it spits out could work with my laser. I only did test this with the greate grbl simulator, but I would guess after some more tweaking it should work on the real machine too.

Here is my Github project with the source files.

IMG_20140920_121713Looks like the image gets flipped when burned, but I flipped it back for this page. I think cardboard in not the best medium for laser engravings, it burns too fast.

real time spindle control aka laser mode for grbl

Screenshot-7$X
G20 G90 G64 G40
T0 M6
G17
G1 F500

G0 X0 Y0 Z0
G1 X20

G0 X0 Y5 Z0
G1 X10
G1 X20

G0 X0 Y10 Z0
M3 S64
G1 X10
S196
G1 X20
M5

G0 X0 Y20 Z0
M3
G1 X10 S255
G1 X20 S127
M5 s0

G0 X0 Y25 Z0
M3
G1 X5 S128
G1 X10 S300
G1 X15 S1000
G1 X20 S255
M5

M30

Here are the changes:
Github Link

Compile time option example:
#if defined(LASER_SPINDLE) && defined(USE_LINE_NUMBERS)
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, float rpm, uint8_t direction, int32_t line_number);
#elif defined(LASER_SPINDLE)
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, float rpm, uint8_t direction);
#elif defined(USE_LINE_NUMBERS)
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, int32_t line_number);
#else
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate);
#endif