Skip to content

Commit

Permalink
fix tooldia
Browse files Browse the repository at this point in the history
  • Loading branch information
tungbuivn committed Jun 30, 2023
1 parent 62119e2 commit 3b4926a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions GCodeProcess/FlatCam/FlatCam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public void Run()
openTop = $"open_gerber {dir}/Gerber_TopLayer.GTL -outname top_layer";
processTop = $@"
ncc top_layer -method Seed -tooldia {_settingsFlatCam.PcbDiameter} -overlap 25 -connect 1 -contour 1 -all -outname ncc_top
cncjob ncc_top -dia {_settingsFlatCam.PcbDiameter} -z_cut -0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRate} -feedrate_z {_settingsFlatCam.ZFetchCopperClear} -pp default -outname top_nc
cncjob ncc_top -dia {_settingsFlatCam.PcbDiameter} -z_cut -0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRateCopperClear} -feedrate_z {_settingsFlatCam.ZFetchCopperClear} -pp default -outname top_nc
write_gcode top_nc {dir}/gb_top_layer.nc
";
}

var cleanPcb = _settingsFlatCam.CleanPcb
? $@"
ncc mg_geo -method Seed -tooldia {_settingsFlatCam.PcbDiameter} -overlap 25 -connect 1 -contour 1 -all -outname geo_bottom_layer
cncjob geo_bottom_layer -dia {_settingsFlatCam.PcbDiameter} -z_cut -0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRate} -feedrate_z {_settingsFlatCam.ZFetchCopperClear} -pp default -outname ncc_bottom_layer
cncjob geo_bottom_layer -dia {_settingsFlatCam.PcbDiameter} -z_cut -0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRateCopperClear} -feedrate_z {_settingsFlatCam.ZFetchCopperClear} -pp default -outname ncc_bottom_layer
write_gcode ncc_bottom_layer {dir}/gb_bottom_layer.nc
"
: "";
Expand All @@ -108,7 +108,7 @@ join_geometry mg_geo cutout bottom_layer
#cutout
geocutout cutout -dia {_settingsFlatCam.CutOutDiameter} -gapsize 0.3 -gaps lr -outname cutout_geo
cncjob cutout_geo -dia {_settingsFlatCam.CutOutDiameter} -dpp 0.3 -z_cut {_settingsFlatCam.DrillDepth} -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRate} -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname cutout_nc
cncjob cutout_geo -dia {_settingsFlatCam.CutOutDiameter} -dpp 0.3 -z_cut {_settingsFlatCam.DrillDepth} -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRateCopperClear} -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname cutout_nc
write_gcode cutout_nc {dir}/gb_cutout_nc.nc
#drill
Expand Down
3 changes: 2 additions & 1 deletion GCodeProcess/FlatCam/FlatCamSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ public class FlatCamSettings
public double DrillDepth { get; set; }
public double ZClearance { get; set; }
public double ZFetchRate { get; set; }
public double XyFetchRate { get; set; }
public double XyFetchRateCopperClear { get; set; }
public int ZProbeFetchRate { get; set; }
public int XyProbeFetchRate { get; set; }
public int ZFetchCopperClear { get; set; }
public int XyFetchRateMillDrill { get; set; }
}
7 changes: 4 additions & 3 deletions GCodeProcess/Gerber/DrillFileParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ string GetDrillingByTool(List<ToolInfo> tl,string key)
if (key == "08")
{
var toolsGt1=string.Join(",", tl.Where(o=>o.Size>1).Select(o => o.Size));
var toolDrillDia = 0.8;
if (!string.IsNullOrEmpty(toolsGt1))
{
milldrill = $@"milldrills drill -milled_dias {toolsDias} -tooldia 0.8 -outname geo_milldrill{key}
cncjob geo_milldrill{key} -dia {_settingsFlatCam.PcbDiameter} -z_cut -2 -dpp 0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate 50 -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname milldrill{key}_nc
milldrill = $@"milldrills drill -milled_dias {toolsDias} -tooldia {toolDrillDia} -outname geo_milldrill{key}
cncjob geo_milldrill{key} -dia {toolDrillDia} -z_cut {_settingsFlatCam.DrillDepth} -dpp 0.1 -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRateMillDrill} -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname milldrill{key}_nc
write_gcode milldrill{key}_nc {Dir}/gb_milldrill{key}.nc
";
//] [-use_thread <str>] [-diatol <float>]
Expand Down Expand Up @@ -62,7 +63,7 @@ string GetMillingByTool(List<ToolInfo> tl, string key)
// {
return $@"
millslots drill -milled_dias ""{toolsDias}"" -tooldia {toolMill} -diatol 0 -outname milled_slots{key}
cncjob milled_slots{key} -dia {_settingsFlatCam.PcbDiameter} -z_cut -2 -dpp {dpp} -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate 50 -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname milled_slots{key}_nc
cncjob milled_slots{key} -dia {toolMill} -z_cut {_settingsFlatCam.DrillDepth} -dpp {dpp} -z_move {_settingsFlatCam.ZClearance} -spindlespeed {_settingsFlatCam.SpindleSpeed} -feedrate {_settingsFlatCam.XyFetchRateMillDrill} -feedrate_z {_settingsFlatCam.ZFetchRate} -pp default -outname milled_slots{key}_nc
write_gcode milled_slots{key}_nc {Dir}/gb_milled_slots{key}.nc
";
// });
Expand Down
5 changes: 3 additions & 2 deletions GCodeProcess/appSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"DrillDepth": "-2",
"ZClearance": "2",
"CleanPCB": "true",
"ZFetchCopperClear": 50,
"XYFetchRate": "300",
"ZFetchCopperClear": "50",
"XYFetchRateCopperClear": "300",
"ZFetchRate": "25",
"XYFetchRateMillDrill": "50",
"ZProbeFetchRate": "50",
"XYProbeFetchRate": "600"
},
Expand Down

0 comments on commit 3b4926a

Please sign in to comment.