Monday, 12 August 2019

Using DXF2Gcode with UCCNC

I have now output a drawing from my proof of concept CNC machine.

Created in Inkscape, saved as a DXF file, processed in DXF2Gcode, loaded in to UCCNC and plotted using a pen as the tool in my CNC machine.

I needed to configure DXF2Gcode to stop the pen crashing in to the page as it tried to act like a cutter. In the process I have learnt some of the configuration for the post processor but apart from a minor compatibility change for UCCNC, the post processor can remain almost as default.

I found some of the choices in DXF2Gcode disappointing. There is a save function for the post processors but not for the Machine settings. That seems to be the reverse of what would normally be needed but perhaps that's just because I am new to CNC control. I'll investigate this further.

Workflow for a plotter
  • Load the DXF file. This takes a few moment. It's not very quick.
  • Turn off layers that are not required. Just untick. The display usually changes to reflect this. (View-Show Disabled Paths)
  • Worth saving the project at this stage.
  • Change settings (Options-Configuration...)
    • Machine config (to generate a single pass and avoid crashing in to the paper)
      • Slice depth = -0.01mm
      • Final mill depth: -0.01mm
  • Apply those changes
  • Options-Postprocessor configuration... (now I have created a suitable config.)
    • Choose configuration file: Plotter_WIP_v7b.cfg (or whichever file is appropriate)
    • Apply that
  • Move the starting point somewhere appropriate (Options-Move Workpiece Zero)
  • Export-Optimize and Export shapes

That works with UCCNC. I have to press the Cycle Start button twice, so I think I still need to sort out the correct G code startup sequence.


On Windows 10
Config file location: C:\Users\%USERNAME%\.config\dxf2gcode\config
Post processor file location: C:\Users\%USERNAME%\.config\dxf2gcode\postpro_config

Each G code needs to be on a separate line. The default startup sequence puts them all on one line. This is easily changed by inserting the returns in to the Startup field on the post processor config page.


Shapecut Series:
Part 1 - Magic Eye to CNC
Part 2 - CNC proof of concept design
Part 3 - CNC controller enclosure


These are some notes that I didn't know where else to put.


DXF2Gcode source:

Alternatives to DXF2Gcode
I've struggled to find a comparable alternative. Most are now inactive projects that have no working links or are far behind what DXF2Gcode can do.
Most of the time I will use Fusion 360. That is more than capable of carrying out this task but it needs a lot more setup than I think should be necessary for most simple profile and 2D cutting jobs.


The Travelling Salesman Problem (TSP)
In reading about CNC G-code generation I kept coming across references to TSP and the Travelling Salesman Problem.
Most articles did not explain what this was but that it was to do with optimising the g-code.

I eventually managed to find an article that explained it. In short:
What is the shortest travel time for the sales person to reach all the destinations on his agenda.

In the context of CNC this relates to the long travel between cuts. What is the optimum number and lengths of travel to accomplish the task in the shortest time.


No comments :