Skip to content

Commit

Permalink
Do a toolchange before milldrilling
Browse files Browse the repository at this point in the history
  • Loading branch information
eyal0 committed Mar 16, 2020
1 parent f3a7098 commit 077d7c0
Show file tree
Hide file tree
Showing 23 changed files with 189 additions and 5 deletions.
18 changes: 13 additions & 5 deletions drill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,19 @@ void ExcellonProcessor::export_ngc(const string of_dir, const boost::optional<st
of << " )\n\n";

//preamble
of << preamble_ext << preamble << "S" << left << target->speed
<< " (RPM spindle speed.)\n" << "G01 F" << target->feed * cfactor
<< " (Feedrate)\nM3 (Spindle on clockwise.)\n"
<< "G04 P" << target->spinup_time
<< "\nG00 Z" << target->zsafe * cfactor << "\n\n";
of << preamble_ext << preamble
<< "S" << left << target->speed << " (RPM spindle speed.)\n\n"
<< "G01 F" << target->feed * cfactor << " (Feedrate)\n"
<< "G00 Z" << target->zchange * cfactor << " (Retract)\n"
<< "T" << (*holes.begin()).first << "\n"
<< "M5 (Spindle stop.)\n"
<< "G04 P" << target->spindown_time << "\n"
<< "(MSG, Change tool bit to drill size " << (bMetricOutput ? (target->tool_diameter * 25.4) : target->tool_diameter) << (bMetricOutput ? "mm" : "inch") << ")\n"
<< "M6 (Tool change.)\n"
<< "M0 (Temporary machine stop.)\n"
<< "M3 (Spindle on clockwise.)\n"
<< "G04 P" << target->spinup_time << "\n"
<< "G00 Z" << target->zsafe * cfactor << "\n\n";

tiling->header( of );

Expand Down
8 changes: 8 additions & 0 deletions testing/gerbv_example/milldrilldiatest/expected/milldrill.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G21 (Units == Millimeters.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S2000 (RPM spindle speed.)

G01 F600.00000 (Feedrate)
G00 Z10.00000 (Retract)
T6
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 1.00000mm)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z1.50000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.07087inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
8 changes: 8 additions & 0 deletions testing/gerbv_example/multivibrator/expected/milldrill.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.03150inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G21 (Units == Millimeters.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F2540.00000 (Feedrate)
G00 Z25.40000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 2.54000mm)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z2.03200
Expand Down
8 changes: 8 additions & 0 deletions testing/gerbv_example/slots-milldrill/expected/milldrill.ngc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T1
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.10000inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ G20 (Units == INCHES.)
G91.1 (Incremental arc distance mode.)
G90 (Absolute coordinates.)
S10000 (RPM spindle speed.)

G01 F100.00000 (Feedrate)
G00 Z1.00000 (Retract)
T2
M5 (Spindle stop.)
G04 P1.00000
(MSG, Change tool bit to drill size 0.04000inch)
M6 (Tool change.)
M0 (Temporary machine stop.)
M3 (Spindle on clockwise.)
G04 P1.00000
G00 Z0.08000
Expand Down

0 comments on commit 077d7c0

Please sign in to comment.