I'm using dxf2gcode to generate Gcode for my Bambu Lab drag knife conversion. I've found that using the parameters provided, I've managed to get pretty good quality results, but one additional feature that I find myself wanting is the ability to slowly ramp the cut in -- and overcut at the end -- to better guarantee that the drag knife is oriented correctly when cutting the workpiece. That is to say, if currently to do cut of a triangle, we do something like (ignoring corner correction):
G1 Z3
G1 X5 Y5
G1 Z-0.5
G1 X15
G1 Y15
G1 X5 Y5
G1 Z3
the problem can be that when the drag knife touches down at X5 Y5, the orientation is unpredictable, and there is not a deterministic thing that we can do to fix it. Instead, I think we ought to slowly ramp the cut in over the course of, say, 5mm:
G1 Z3
G1 X5 Y5
G1 Z0
G1 X10 Z-0.5
G1 X15
...
and at the end, to compensate for the bit that we lost, "overcut" those 5mm:
...
G1 Y15
G1 X5 Y5
G1 X10
G1 Z3
Of course we would also need the drag knife radius compensation in here in the movement but you get the idea for how this should work. I got this idea from jscut, which cuts in multiple passes.
Does this seem like something that would be easy to do?
Thanks!
joshua
Hi Joshua, i think this would be a great addition to dxf2gcode and its drag knive capabilities. A lot of that function is already there for milling, but not integrated for drag knive cutting. I won't have time in the near future to integrate it by myself, but if you are willing to dig a bit into the code, i would do my best to support you in making it work and give you some hints and how to implement it ...
Sounds great! Any pointers you could provide, I'd appreciate. I did a quick skim of the code and saw a few places that seemed like good options to put it, but I'm sure there's someplace that seems like 'obviously the right place' from your perspective :-) I'll probably have some time this afternoon or tomorrow to mess with it.
Thanks!
I would try to start by adding a configuration to enable or disable it, somewhere here:
Add a new version a the end: https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/globals/config.py#l49
Add a new line with the config option you want to add:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/globals/config.py#l187 and add it to the config window here:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/globals/config.py#l552
Next step add the code:
Add the value to the shape, if requried ..
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/shape.py#l95
Add the code in the following function:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/shape.py#l637
(Should be very similar to here specially check the start / end move :
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/shape.py#l407
It starts here with start moves:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/shape.py#l493 , not that sure anymore look on the next one first)
Maybe you need to add it only here:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/develop/tree/source/dxf2gcode/core/stmove.py#l209
Thanks for the pointers! Here's kind of what I'm thinking:
I will make
updateShape/make_start_movescall another routine beforemake_swivelknife_move, which will measure the path length of geos along the way, and set a z coordinate on them from 0.0 to 1.0 (I haven't figured out exactly whether a geo has that property or not yet). It will ramp in from depth 0.0 to depth 1.0 over the length defined by a config parameter. Then it will 'overcut' by the length defined by another config parameter, by repeating an appropriate number of geos at the end. (If the shape is not closed, or it is not long enough to do this thing, we skip it.)Then I will augment Write_GCode_Drag_Knife to read the Z parameter and, rather than moving between the two Z positions, use the current cut depth as the Z parameter from the last geo.
Does this make sense? It seems like this ought work.
Sound at least like a plan. I also think this ought work...
You will find a value for the length of each geometry of a shape:
e.g:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/arcgeo.py#l114
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/linegeo.py#l57
You will also find a normal vector for the start and end point to do the overcut:
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/linegeo.py#l90
https://sourceforge.net/p/dxf2gcode/sourcecode/ci/master/tree/source/dxf2gcode/core/arcgeo.py#l230
Any news on this?