I'm just starting to learn KiCad.
There are some external utilities that produce GCode from gerber files. I have not tried any.
FreeCAD cannot import gerber files, but there is a very nice workbench KicadStepUp that can import from a kicad_pcb file.
I'm trying to glue KicadStepUp and Path. At this time there are too many manual steps. Basically just find the areas where copper has to be removed and then use Path Pocket to handle them.
I don't know if there is demand. Ideas on how to proceed?
In the pictured example the PCB image was added and manually aligned with the generated path. Path colors were changed for better visibility.
I wish I could use "Spiral" for the pocket operation. When trying it did not complete in about an hour and I had to kill FreeCAD.
-- Itai
PCB using CNC engraver
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
PCB using CNC engraver
- Attachments
-
- KiCad-test.FCStd
- (588.54 KiB) Downloaded 42 times
Re: PCB using CNC engraver
Adding a macro that I use to extract the pcb outline and the areas where copper has to be removed.
- Attachments
-
- PcbCnc.py
- (2.68 KiB) Downloaded 74 times
Re: PCB using CNC engraver
I'd rather use flatcam and Autoleveller for that job.
Re: PCB using CNC engraver
you may consider fcad_pcb which is designed to do itnahshon wrote: ↑Fri Dec 31, 2021 1:56 pm I'm just starting to learn KiCad.
There are some external utilities that produce GCode from gerber files. I have not tried any.
FreeCAD cannot import gerber files, but there is a very nice workbench KicadStepUp that can import from a kicad_pcb file.
-- Itai
https://github.com/realthunder/fcad_pcb
FreeCAD scripts for PCB CAD/CAM & FEM
fcad_pcb is yet another way to improve ECAD/MCAD collaboration between FreeCAD and KiCAD.
The original purpose of these tools was to do PCB milling in FreeCAD. It can do much more now.:
It can generate gcode from kicad_pcb directly without going through the gerber stage.
It can let your modify the PCB directly inside FC (done already),
and potentially export back to kicad_pcb (partially done).
and finally it can generate solid tracks, pads and plated drills to enable FEM and thermal analysis on KiCad pcb boards.
Re: PCB using CNC engraver
I tried it an still haven't found a way to produce any gcode. It looks like all the effort is into creating a model for FEM.easyw-fc wrote: ↑Sun Jan 02, 2022 9:06 am you may consider fcad_pcb which is designed to do it
https://github.com/realthunder/fcad_pcb
Anyway, the fcad_pcb project hasn't got beyond typing commands into the python console. I don't see it taking a practical, user friendly direction.
Re: PCB using CNC engraver
Edit: Fixed bugs and updated attached file.
Ok, I had some progress.
The updated macro PcbCnc.py is doing almost everything.
It's expecting a job template job_PCB.json (attached example) in the same directory as the python file. Using these tools from the template:
The macro works very well for my small PCB examples. It failed badly for some more complex cases. I do not know if the problems are from the KicadStepUp workbench that I use or from LibArea that is used to process pockets, or anything in the middle.
Generated operations:
Ok, I had some progress.
The updated macro PcbCnc.py is doing almost everything.
It's expecting a job template job_PCB.json (attached example) in the same directory as the python file. Using these tools from the template:
- Tool#11: an endmill to remove copper, Usually about 0.2mm.
- Tool#12: An endmill to to cut the profile of the PCB.
- All other tools are drill bits.
The macro works very well for my small PCB examples. It failed badly for some more complex cases. I do not know if the problems are from the KicadStepUp workbench that I use or from LibArea that is used to process pockets, or anything in the middle.
Generated operations:
- Pocket operation for each copper layer.
- Bottom side is mirrored. Alignment holes are not generated.
- Drilling operation for all drill sizes.
- Each drill bit is used for holes smaller or equal its diameter, which cannot be drilled with a smaller drill bit.
- Large circular holes that do not have large enough drill bit will cause an error (they should be processed with profile or helix operation).
- Profile operation for the outside shape and for holes that are not circles.
- Since all operations are Path WB Operations, the user can make changes before actually creating the G-Code.
- Attachments
-
- PcbCnc.zip
- (4.97 KiB) Downloaded 75 times