Compare commits
4 Commits
70a48539bb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| d9e11c82ad | |||
| 38faf6ccc9 | |||
| e23a8ac222 | |||
| c750849779 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
output/
|
||||
gcode/
|
||||
gerbers/
|
||||
|
||||
|
||||
14
Readme.md
14
Readme.md
@@ -2,9 +2,9 @@ TODO: Add table of content
|
||||
# Exporting gcode for CNC
|
||||
|
||||
## pcb2gcode
|
||||
Use CNC for drilling holes and milling board outlines. You can also use CNC for isolation traces milling. However, the best result will give you MSLA PCB exposure. TODO: Add link to the section
|
||||
Use CNC for drilling holes and milling board outlines. You can also use CNC for isolation traces milling. However, the best result will give you MSLA PCB exposure.
|
||||
|
||||
Adapt milling and drilling parameters in `millproject`. Look up [pcb2gcode/wiki](https://github.com/pcb2gcode/pcb2gcode/wiki) for help.
|
||||
Adapt milling and drilling parameters in the config file `millproject`. Look up [pcb2gcode/wiki](https://github.com/pcb2gcode/pcb2gcode/wiki) for help.
|
||||
```bash
|
||||
nano millproject
|
||||
```
|
||||
@@ -15,14 +15,14 @@ nano millproject
|
||||
```
|
||||
|
||||
Launch the `gSender` program.
|
||||
* Load the `output/gcode/drill.ngc` file for drilling holes.
|
||||
* Load the `output/gcode/outline.ngc` file for milling the board outlines.
|
||||
* Load the `output/gcode/back.ngc` file if you want to mill the isolation traces.
|
||||
* Load the `output/gcode/front.ngc` file if you want to mill the isolation traces.
|
||||
* Load the `gcode/drill.ngc` file for drilling holes.
|
||||
* Load the `gcode/outline.ngc` file for milling the board outlines.
|
||||
* Load the `gcode/back.ngc` file if you want to mill the isolation traces.
|
||||
* Load the `gcode/front.ngc` file if you want to mill the isolation traces.
|
||||
|
||||
## Milling tip: Increase the thermal spoke and trace width
|
||||
When routing for milling, use the widest traces possible. 1mm, 2mm and wider, the machine doesn't care, but later you won't be soldering leads to small fragile strips of copper. You can use copper pours for routing too.
|
||||
|
||||
Set up the entire back side as one big GND pour. Then, increase the thermal spoke width to be larger than 1mm. This avoids small features and gives more room for error if a larger drill is used for the holes.
|
||||
|
||||

|
||||

|
||||
|
||||
34
export.sh
34
export.sh
@@ -2,8 +2,8 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
GERBERS_DIR="output/gerbers"
|
||||
GCODE_DIR="output/gcode"
|
||||
GERBERS_DIR="gerbers"
|
||||
GCODE_DIR="gcode"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 <kicad_pcb_file>"
|
||||
@@ -11,27 +11,29 @@ usage() {
|
||||
}
|
||||
|
||||
PCB_FILE="$1"
|
||||
PCB_FILE_PREFIX="$(basename "$PCB_FILE" .kicad_pcb)"
|
||||
|
||||
mkdir -p "$GERBERS_DIR"
|
||||
mkdir -p "$GCODE_DIR"
|
||||
|
||||
# Export drill, front and back layers as gerber files.
|
||||
# Export drill, outline, front and back layers as gerber files.
|
||||
echo "Exporting gerbers..."
|
||||
kicad-cli pcb export drill -o "$GERBERS_DIR" "$PCB_FILE"
|
||||
kicad-cli pcb export drill --generate-map -o "$GERBERS_DIR" "$PCB_FILE"
|
||||
kicad-cli pcb export gerbers -o "$GERBERS_DIR" -l Edge.Cuts "$PCB_FILE"
|
||||
kicad-cli pcb export gerbers -o "$GERBERS_DIR" -l Front "$PCB_FILE"
|
||||
kicad-cli pcb export gerbers -o "$GERBERS_DIR" -l Back "$PCB_FILE"
|
||||
kicad-cli pcb export gerbers -o "$GERBERS_DIR" -l Edge.Cuts "$PCB_FILE"
|
||||
# kicad-cli pcb export svg -o "$GERBERS_DIR" -l Edge.Cuts \
|
||||
# --mode-multi --page-size-mode 1 --black-and-white \
|
||||
# --drill-shape-opt 0 --exclude-drawing-sheet "$PCB_FILE"
|
||||
|
||||
# Export outlines of the penelized board i.e. use the layer 'User.Eco1'.
|
||||
# echo "Exporting panelized outlines from layer 'User.Eco1'..."
|
||||
# python3 export_panel_outlines_gerber.py \
|
||||
# --layers User.Eco1 \
|
||||
# --output "$GERBERS_DIR" \
|
||||
# "$PCB_FILE"
|
||||
|
||||
# Input layers/filenames and all milling/drilling parameters are taken from the config file: 'millproject'.
|
||||
echo "Exporting Gcode..."
|
||||
docker run --rm -i -t \
|
||||
echo "Exporting Gcode for drilling, outline and isolation traces routing..."
|
||||
docker run --rm -it \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
-v "$(pwd):/data" \
|
||||
ptodorov/pcb2gcode
|
||||
ptodorov/pcb2gcode \
|
||||
--config millproject \
|
||||
--output-dir "$GCODE_DIR" \
|
||||
--front "$GERBERS_DIR/$PCB_FILE_PREFIX-Front.gtl" \
|
||||
--back "$GERBERS_DIR/$PCB_FILE_PREFIX-Back.gbl" \
|
||||
--drill "$GERBERS_DIR/$PCB_FILE_PREFIX.drl" \
|
||||
--outline "$GERBERS_DIR/$PCB_FILE_PREFIX-Edge_Cuts.gm1"
|
||||
BIN
images/spoke_width.png
Normal file
BIN
images/spoke_width.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 250 KiB |
17
millproject
17
millproject
@@ -1,11 +1,3 @@
|
||||
front=output/gerbers/Flow_Controller_Panel-Front.gtl
|
||||
back=output/gerbers/Flow_Controller_Panel-Back.gbl
|
||||
drill=output/gerbers/Flow_Controller_Panel.drl
|
||||
outline=output/gerbers/Flow_Controller_Panel-Edge_Cuts.gm1
|
||||
|
||||
# Use the 'User-Eco1' layer instead as it contains panelized board's slot outlines only.
|
||||
#outline=output/gerbers/Flow_Controller_Panel-User-Eco1.gbr
|
||||
|
||||
# Generic
|
||||
metric=true # use metric units for parameters
|
||||
metricoutput=true # use metric units for output
|
||||
@@ -13,7 +5,6 @@ nog64=true # do not set an explicit g64
|
||||
#nom6=true # do not emit m6
|
||||
zsafe=2 # The height in mm at which the bit can move freely without obstruction
|
||||
zchange=35 # Tool changing height in mm
|
||||
output-dir=output/gcode
|
||||
|
||||
# Place a 5x7cm board in the lower right quadrant of the coordinate system
|
||||
# This will allow you to probe the fixed jaw of the vise for (0,0) on the CNC.
|
||||
@@ -41,7 +32,7 @@ voronoi=true # cuts the milling time significantly, but check with this o
|
||||
preserve-thermal-reliefs = true # has effect only if voronoi=true
|
||||
|
||||
# Cutting
|
||||
zcut=-4
|
||||
zcut=-2.2
|
||||
cutter-diameter=2.1
|
||||
cut-feed=400
|
||||
cut-vertfeed=50
|
||||
@@ -50,6 +41,6 @@ cut-speed=24000
|
||||
cut-side=back
|
||||
|
||||
# Tabs
|
||||
#bridgesnum=4 # Total 4 tabs
|
||||
#bridges=0.5 # Tab width 0.5 mm
|
||||
#zbridges=0 # bridges height (default to zsafe)
|
||||
bridgesnum=4 # Total 4 tabs
|
||||
bridges=0.5 # Tab width 0.5 mm
|
||||
zbridges=0.8 # bridges height (default to zsafe)
|
||||
|
||||
Reference in New Issue
Block a user