dxf2gcode for laser cutter

693 views
Skip to first unread message

tux...@gmail.com

unread,
Sep 10, 2016, 4:17:36 PM9/10/16
to dxf2gcode-dev
Hi

I bought a Chinese laser, with a Chinese driver, and Chinese software.
The machine is worth the money, but the driver and software are absolutely useless.
I replaced the driver to GRBL and the machine running as it should.
Now the problem is the lack of software to create appropriate G-Code.
Laser plotter does not have a Z-axis, but requires the laser power control.
In one program may be fragments responsible for cutting, engraving and marking material.
It would be best if for every shape you can assign a different laser power.
I made a makeshift changes in dxf2gcode, and the effect is acceptable, but far from ideal.
Firstly windows and texts responsible for the Z axis I hid under the window "Feed rate XY", and changed the name "Feed rate Z" to "Laser power".
Then I changed in the config file:

    # This is code which will be written at the beginning of the exported file.
    code_begin = G61 (Default cutting) G17 (XY plane) S0 (Laser off)
    # This is code which will be written at the end of the exported file.
    code_end = S0 M2 (Program end)

and:

    # This will be done after each layer, if different tools are used.
    tool_change = ""
    # This will be done after each change between cutting in plane or cutting in depth.
    feed_change = ""
    # This will be done between each shape to cut.
    rap_pos_plane = G0 X%XE Y%YE%nl
    # This will be done between each shape to cut.
    rap_pos_depth = ""
    # This will be used for shape cutting.
    lin_mov_plane = G1 X%XE Y%YE F%feed%nl
    # This will be used for shape cutting.
    lin_mov_depth = S%feed%nl
    # This will be used for shape cutting.
    arc_int_cw = G2 X%XE Y%YE I%I J%J F%feed%nl
    # This will be used for shape cutting.
    arc_int_ccw = G3 X%XE Y%YE I%I J%J F%feed%nl
    # Generally set to G40%nl
    cutter_comp_off = G40%nl
    # Generally set to G41%nl
    cutter_comp_left = ""
    # Generally set to G42%nl
    cutter_comp_right = ""
    # This will be done before starting to cut a shape or a contour.
    pre_shape_cut = M3%nl
    # This will be done after cutting a shape or a contour.
    post_shape_cut = M5%nl

The effect of this is, for example:

(* SHAPE Nr: 0 *)
G0 X  52.929 Y  52.929
M3
S150
G2 X  67.071 Y  67.071 I   7.071 J   7.071 F3000
G2 X  52.929 Y  52.929 I  -7.071 J  -7.071 F3000
S150
M5

But it should be:

(* SHAPE No. 0 *)
G0 X 52,929 Y 52,929
S150 F3000
M3
G2 X  67.071 Y  67.071 I   7.071 J   7.071
G2 X  52.929 Y  52.929 I  -7.071 J  -7.071
M5
S0

It is very important to set the laser power before turning it on.
I do not like the idea to use a tool change to change laser power, different programs react differently to the M6, for example, can stop and wait for pressing a key ...

Does anyone find the time and desire to take care of this problem?

Regards.

Christian Kohlöffel

unread,
Sep 11, 2016, 4:04:53 PM9/11/16
to dxf2gc...@googlegroups.com
Hi Tux,

i do not see the line in which the S150 is generated. Can you please
detail this a bit for me?

Did you try this already? I think you can use the tool speed to define
the power for each tool and then use it for each shape cutting.

use:
# This will be done before starting to cut a shape or a contour.
pre_shape_cut = S%speed F%feed %nl M3%nl
# This will be done after cutting a shape or a contour.
post_shape_cut = M5%nl

regards
Christian

tux...@gmail.com

unread,
Sep 11, 2016, 5:27:27 PM9/11/16
to dxf2gcode-dev

I attach a picture that should explain everything.




In the window of Z-axis speed I set the laser power. I also changed the name of the window.
Now %feed means F parameter for the XY moves, or S parameter, when in theory the Z-axis penetrates the material but in practical laser turns on ( so instead G1 Z%ZE F%feed we have M3 S%feed ).
This causes a problem because the same parameter means different things and I can not use it when I want.
The solution will be make two variables %feedXY and %feedZ instead one %feed.
When it will be done, you can use what you want when you want.
Control programs react differently to code M6, then I do not want to use it.
The S parameter I can change when I want and how many times I want, and machine control program has to simply change the PWM and not to take other actions.

What I did is not a good solution, but it works and you can think of something similar but made professionally.

burakko...@gmail.com

unread,
Sep 22, 2017, 7:36:14 AM9/22/17
to dxf2gcode-dev
Dear Tux,

Could you say me which IDE did you use for changing DXF2GCODE (GUI and CODES)? 

Best Regards,
Burak

12 Eylül 2016 Pazartesi 00:27:27 UTC+3 tarihinde tux...@gmail.com yazdı:

Christian Kohlöffel

unread,
Sep 25, 2017, 3:29:21 PM9/25/17
to dxf2gc...@googlegroups.com

Additional, for the GUI you can use QT Designer. Thats the one i used a Long time ago.

 

Von: burakko...@gmail.com
Gesendet: Freitag, 22. September 2017 13:36
An: dxf2gcode-dev
Betreff: Re: [dxf2gcode-dev] dxf2gcode for laser cutter

 

Dear Tux,

 

Could you say me which IDE did you use for changing DXF2GCODE (GUI and CODES)? 

 

Best Regards,

Burak

12 Eylül 2016 Pazartesi 00:27:27 UTC+3 tarihinde tux...@gmail.com yazdı:

https://lh3.googleusercontent.com/-AwvhcsRdb-I/V9XKyGrKdnI/AAAAAAAAAAQ/wyPvkyiua5INrGwzZ-mRIcpTzEHZGiAagCLcB/s320/laser_explanation.png


In the window of Z-axis speed I set the laser power. I also changed the name of the window.
Now %feed means F parameter for the XY moves, or S parameter, when in theory the Z-axis penetrates the material but in practical laser turns on ( so instead G1 Z%ZE F%feed we have M3 S%feed ).
This causes a problem because the same parameter means different things and I can not use it when I want.
The solution will be make two variables %feedXY and %feedZ instead one %feed.
When it will be done, you can use what you want when you want.
Control programs react differently to code M6, then I do not want to use it.
The S parameter I can change when I want and how many times I want, and machine control program has to simply change the PWM and not to take other actions.

What I did is not a good solution, but it works and you can think of something similar but made professionally.




W dniu niedziela, 11 września 2016 22:04:53 UTC+2 użytkownik Chrisko napisał:

Hi Tux,

i do not see the line in which the S150 is generated. Can you please
detail this a bit for me?

Did you try this already? I think you can use the tool speed to define
the power for each tool and then use it for each shape cutting.

use:
     # This will be done before starting to cut a shape or a contour.
     pre_shape_cut = S%speed F%feed %nl M3%nl
     # This will be done after cutting a shape or a contour.
     post_shape_cut = M5%nl

regards
Christian

--
--
You received this message because you subscribed to the Google
Groups-group "dxf2gcode-dev".
To post a message, send mail to dxf2gc...@googlegroups.com
To unsubscribe, send mail to dxf2gcode-de...@googlegroups.com
See http://groups.google.de/group/dxf2gcode-dev?hl=en for more options
and the dxf2gcode project page at http://code.google.com/p/dxf2gcode/
---
You received this message because you are subscribed to the Google Groups "dxf2gcode-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dxf2gcode-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

 

Message has been deleted

tux...@gmail.com

unread,
Jun 17, 2018, 1:53:40 PM6/17/18
to dxf2gcode-dev
Hi.

IDE ?
I use gedit .

-----------------

I do not know how to explain to you.
Theoretically, it is simple.
Only the X, Y plane and only F, S parameters are sufficient for the laser cutter.
Even M3 and M5 are not needed, because when the S0 laser is off ...

Attached is my modified dxf2gcode.


Version :

Py2.7.12 PyQt5.5.1: $Revision: 306a57208bc233b86be368bd019159e3d0d9afcf $
Last change: $Date: Sun Apr 17 16:32:22 2016 +0200 $


This is for Linux, you must be root.

dxf2gcode-laser.tar

Adam tuxcnc

unread,
Aug 16, 2020, 10:35:49 AM8/16/20
to dxf2gcode-dev
Hi
Some time has passed ...
Now I use 2019.10.25 version with my own config.
The most important fragment is :

Program]
    post_shape_cut = S0 M5%nl
    # Defines comments' format. Comments are written at some places during the export in order to make the g-code better readable.
    comment = %nl(%comment)%nl

The line lin_mov_depth = S%feed%nl means the "Feed Rate Z" value is transleted not in Fnnnn but Snnnn.
It results the linear move in Z plane is replaced by laser power PWM.
It is usefull for foamcutter too, I suppose.
Works fine, but ...
You must remember the "Feed Rate Z" is "Laser Power", you must calculated and changed "Z Infeed depth" and "Z Final mill depth" if you want multiple cuts, and last but not least, you see windows you not need to use.

The question is :
Is it possible to add entries to the cfg file, that would result in:
1. Hide the window
2. Rename the window
3. Displaying a window needed only for a given type of machine (e.g. for a laser, "Repeat several times")

Regards

James Walker

unread,
May 16, 2021, 7:25:38 PM5/16/21
to dxf2gcode-dev
Hi.  Interested in the usage pattern for Lasers.  I am doing work on the code base at the moment that is more Plasma centric since that is the itch I am scratching.  However it should be possible to extend it to support some features more applicable to Lasers.  Such as multiple passes across the same cutline.

So if you have some feature requests while I have things out on the workbench let me know.

I'm github based so repo is: https://github.com/joco-nz/dxf2gcode-plasma

Nothing has been merged back into master as yet. I am using branch:develop as taken from the upstream repo and extending on it.

Cheers - J.
Reply all
Reply to author
Forward
0 new messages