arkypita / LaserGRBL

Laser optimized GUI for GRBL
http://lasergrbl.com
Other
1.26k stars 497 forks source link

Make it work with Marlin firmware #2357

Open g3gg0 opened 2 months ago

g3gg0 commented 2 months ago

I tried running a recent marlin with LaserGrbl but unfortunately there were some issues.

  1. default buttons use grbl specific (non)g-code commands like $H and $30 and such, converting them inline
  2. having a M3/M4 in a G-line is not supported, using "Mx I" instead
  3. S-commands without M/G is not supported, prepend last M command

it requires some defines in marlin of course. here some of them

// i am using an ESP3D for telnet remote and with lower buffer sizes, there were lot protocol errors
#define RX_BUFFER_SIZE 1024
#define SERIAL_XON_XOFF

// obvious
#define LASER_FEATURE

// for the M3/4 I commands and G with S to work
#define LASER_POWER_SYNC

#define PAREN_COMMENTS      // Support for parentheses-delimited comments
// not really required as i convert them
#define GCODE_MOTION_MODES  // Remember the motion mode (G0 G1 G2 G3 G5 G38.X) and apply for X Y Z E F, etc.

finally it converted the various flavours of S-M and G-command mixing properly.

one hint - one should change the postamble (and maybe the focus helper) to contain a "M5 I" to make M3 enable the laser directly.