Drive laser in GCode without Benbox


#1

I’m using GRemote to drive my plotter. Works very well as I have Meshcam that creates my G-Code. I want to be able to turn my laser on from G-Code. I’ve seen post where people are doing this using Z axis, but the posts are very cryptic and incomplete. So, here’s my ask;

  1. Can anyone show a wiring diagram or explain, specifically, what wires go where? I assume M2 cannot be controlled Gcode.

  2. How do you configure GRemote to operate with the laser?

  3. What Gcodes do you send to turn on/off? What about power levels? Can you control those? If so, how?

BTW: Please do not mention anything about BenBox,mLaser, etc… Not interested in any way of using them. :slight_smile:
Thanks in advance!!


#2

3:
“M4 n” controls the laser power. “M4 0” = off “M4 100” = full power.

I found this out by looking in the mDraw python files. The laser commands are in XYRobot.py


#3

M4 only controls the laser in mDraw, not when GRemote (GCodeParser.ino) Firmware is loaded!

I have the same problem and am half-way on the solution line:

Jason Dorie has modified GCodeParser - read here: Upgraded XY plotter - 6W laser

Just comment out the includes for makeblock.h and servo.h in GCodeParser.ino and include MeOrion.h respective the correct includefile for your board. It runs really fast BUT there are some adaptions to do (for example, wrong x-direction in my case). I will have some more try…


#4

I think standard Gcode for tool start and stop are M03 (start) and M04 (stop) with S ie. S255 being the power setting. So a turn on would be M03 S255 for example.


#5