Welcome! Log In Create A New Profile

Advanced

GCode Laser offset - how?

Posted by StlLooking 
GCode Laser offset - how?
June 18, 2019 05:45PM
Hi, I have added a small laser to my A6 carriage. It is mounted on the print-nozzle X-centreline and 70mm in front of the nozzle on the Y-axis. Because the laser gcode is not created in a slicer, I cannot define the nozzle start-offset position so I have set Marlin for 2 nozzles.

I now need to add the second nozzle definition in the gcode. How do I do that? I have found some things online, but they mention M6/G6 tool-change but Marlin does not list M6 or G6 that I can find.

So, what do I need to do so that the A6 only uses nozzle #2.

Thanks.
VDX
Re: GCode Laser offset - how?
June 18, 2019 06:34PM
... changing between nozzles is normally done with "T0" for first nozzle and "T1" for second.

If you can't set and activate tool-offset, then you could add this GCode-sequence:

"G91" - change to relative coordinates
"G0 X{xxx} Y{yyy}" - where xxx/yyy are the offset coordinates between the tools
"G90" - return to absolute coordinates
"G92 X0 Y0" - if you want to set the actual position as coordinate 0,0 ...

Edited 1 time(s). Last edit at 06/18/2019 06:35PM by VDX.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org]
Call for the project "garbage-free seas" - [reprap.org]
Re: GCode Laser offset - how?
June 18, 2019 07:01PM
Alternatively you can set the offset right after homing:
G28
G92 Y-70
Now when moving to 0 the laser should point at the corner instead of the nozzle.

That's not always what you want though. I setup the material on the buildplate, then set the laser to its minimum intensity, point it at the center or front-left corner, depending on the origin set in the cam software.
The material can't always be aligned with coordinates 0,0. Ie if you tape down some paper, you'll need room for the tape to stick.


--
Kind regards
Imqqmi

NFAN CoreXY printer:
[reprap.org]
Re: GCode Laser offset - how?
June 19, 2019 03:40PM
Thanks, I have a metal "L" stuck to the bed in the former 0,0 position so locating things will be the inside corner of the "L" as 0,0.
Re: GCode Laser offset - how?
June 19, 2019 05:34PM
What software are you using to produce G-code?
How does the software turn laser ON/OFF and set power?

My experience with GRBL laser engraver
I guess people do it in Marlin?

For a while I used a micro switch on Z axis to close when Z < 0 and fire laser

Laser/Spindle Configuration
[marlinfw.org]

Laser web lets you set laser ON/OFF command produced in G-code
[laserweb.yurl.ch]#


confused smiley
VDX
Re: GCode Laser offset - how?
June 19, 2019 05:59PM
... I'm using the STEP-pulses of the extruder to generate laser-pulses -- they are "synchronized" with acceleration, so perfect distributed along a line segment.

The "power" is set by an analogue voltage, which defines the pulse-length -- between 5 an 50 microseconds for engraving, up to 500 microseconds (and then slower moving too) for cutting ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org]
Call for the project "garbage-free seas" - [reprap.org]
Re: GCode Laser offset - how?
June 20, 2019 05:08PM
Quote
cozmicray
What software are you using to produce G-code?
How does the software turn laser ON/OFF and set power?

Inkscape and the JTech (Vector) and/or 305 Engineering (Raster). Both are just on/off for intensity. The laser takes a 5vdc PWM signal for infinitely variable intensity and I have soldered wire to the leg of the Fan MOSFET. So far though both of the above GCode generators make you set an intensity and they just turn it off at the end of a line and on again at the start of the next one. It works fine for cutting. I will build a database of intensities for various processes. cutting and marking.

So far I have no need for variable intensity raster like photographs etc. I do have another old 35W CO2 Synrad laser that will do all that, but it runs by a bespoke printer-driver via Corel 5 and windows 3.11. No mistake there, win-3.11, circa 1993. But I intend to upgrade the electronics to a Nano or maybe even an MKS-SBASE so variable intensity raster will become a desirable thing.

For now, I am just experimenting with the current day electronic options using the A6 printer and 3.5W Diode laser as it sits on a desk inside the house.
Re: GCode Laser offset - how?
June 20, 2019 05:12PM
Quote
VDX
The "power" is set by an analogue voltage, which defines the pulse-length -- between 5 an 50 microseconds

I think I recently read about your setup using your own design circuit board and that's way out of my knowledge arena. I need to find a solution that is low cost off the shelf parts like a Nano/MKS etc as I have them here..
VDX
Re: GCode Laser offset - how?
June 20, 2019 06:56PM
... my "intelligent drivers" are built around an Arduino and pretty simple programmed - the Arduino reads (while booting an after every reset-trigger) an analogue input to define the pulse-length ... and then it's only "reacting" per interrupt to an input pulse by outputting a pulse with this predefined pulse-length ... there is virtually no code in the main loop smoking smiley


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org]
Call for the project "garbage-free seas" - [reprap.org]
Sorry, only registered users may post in this forum.

Click here to login