G20 G90 G64 G40
G0 X0 Y0 Z0
G0 X0 Y5 Z0
G0 X0 Y10 Z0
G0 X0 Y20 Z0
G1 X10 S255
G1 X20 S127
G0 X0 Y25 Z0
G1 X5 S128
G1 X10 S300
G1 X15 S1000
G1 X20 S255
Here are the changes:
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);
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, float rpm, uint8_t direction);
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, int32_t line_number);
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate);
5 thoughts on “real time spindle control aka laser mode for grbl”
What grbl version and mod are you using?
I can’t get laser / router switch to work in grbl0.9g
Have a look at my edge branch: https://github.com/alpharesearch/grbl/tree/edge
Also check out this new forum: http://www.engraving-lasers.com/
PWM works nicely, not sure what can the 2W laser diode do with less than 50%, did you cut any paper or just engrave-burn surfaces?
are the limit switches working for you? did you also bypass the z limit switch? Somehow I am get Homing fail, I had a modified version of grbl before that bypassed the z axis homing (on config.h file)
Yes, if I remember right the 2W laser is only useful with settings above 50%. I did not play with my laser for a long time, but I do remember I used <1% (1) so I could see the laser without burning something. This was helpful to match the part with the cut or engraving starting point for example.
My limit switches are working fine with or without the laser. I have my layer mounted so that after homing it is able to focus on the scrap board. Now I just need to measure the height of the item I want to engrave and I set the Z via a manual g code command. My G code file doesn't have any Z so it stays with what I set befor I start it. But I didn't play with my ShapeOko for some time now...
Hello, after I discovered a micropause in spindle speed change in GRBL with my laser, I found your forum and grbl’s branch. I’d tried your version (I didn’t forget to enable laser mode in config before compiling and in $40 cmd), now speed seems not drop as it was in original grbl, but image still looks like prev setup, like still there are some delay at speed change that ‘blur’ speed values and it looks like almost no changes in laser power (but still noticeable in places with large gradient). Am I missing something? Also, arduino ide says hex file takes 97% of memory, but still compile. I use 0.5W violet diode, wood, and speed 1800mm/min, so it wouldn’t overburned.