From 627a8943856c70ef12232e5dbaa1397587198f98 Mon Sep 17 00:00:00 2001 From: Martin Michalec Date: Sun, 22 Feb 2026 06:18:43 +0300 Subject: add RS274/NGC samples --- res/nist/canned-cycles.nc | 50 ++++++++++++++++++++++++++++++++++++++ res/nist/expressions.nc | 48 ++++++++++++++++++++++++++++++++++++ res/nist/simple.nc | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 160 insertions(+) create mode 100644 res/nist/canned-cycles.nc create mode 100644 res/nist/expressions.nc create mode 100644 res/nist/simple.nc (limited to 'res/nist') diff --git a/res/nist/canned-cycles.nc b/res/nist/canned-cycles.nc new file mode 100644 index 0000000..ce50390 --- /dev/null +++ b/res/nist/canned-cycles.nc @@ -0,0 +1,50 @@ +n0010 g20 (cycle test) +n0020 g17 g43 h1 m3 s1234 f16 (start in XY-plane) +n0030 g81 x3 y4 r0.2 z-1.1 +n0040 x1 y0 r0 g91 l3 (three more g81’s an inch apart) +n0050 y-2 r0.1 (one more g81) +n0060 g82 g90 x4 y5 r0.2 z-1.1 p0.6 +n0070 x2 z-3.0 (one more G82) +n0080 g91 x-2 y2 r0 l4 (four more g82’s) +n0090 g83 g90 x5 y6 r0.2 z-1.1 q0.21 +n0100 g84 x6 y7 r0.2 z-1.1 +n0110 g85 x7 y8 r0.2 z-1.1 +n0120 g86 x8 y9 r0.2 z-1.1 p902.61 +n0130 g87 x9 y10 r0.2 z-1.1 i0.231 j-0 k-3 +n0135 g91 x1 r0.2 z-1.1 i0.231 j-0 k-3 +n0140 g88 x10 y11 r0.2 z-1.1 p0.3333 +n0150 g89 x11 y12 r0.2 z-1.1 p1.272 +n0160 m4 (run spindle counterclockwise) +n0170 g86 x8 y9 r0.2 z-1.1 p902.61 +n0180 g87 x9 y10 r0.2 z-1.1 i0.231 j-0 k-3 +n0190 g88 x10 y11 r0.2 z-1.1 p0.3333 + +n0220 g18 m3 (now run all cycles in the XZ-plane) +n0230 g81 z3 x4 r0.2 y-1.1 +n0240 g91 z1 x0 r0 l3 +n0260 g82 g90 z4 x5 r0.2 y-1.1 p0.6 +n0280 g91 z-2 x2 r0 l4 +n0290 g83 g90 z5 x6 r0.2 y-1.1 q0.21 +n0300 g84 z6 x7 r0.2 y-1.1 +n0310 g85 z7 x8 r0.2 y-1.1 +n0320 g86 z8 x9 r0.2 y-1.1 p902.61 +n0330 g87 z9 x10 r0.2 y-1.1 k0.231 i-0 j-3 +n0335 g91 z1 r0.2 y-1.1 k0.231 i-0 j-3 +n0340 g88 z10 x11 r0.2 y-1.1 p0.3333 +n0350 g89 z11 x12 r0.2 y-1.1 p1.272 + +n0420 g19 (now run all cycles in the YZ-plane) +n0430 g81 y3 z4 r0.2 x-1.1 +n0440 g91 y1 z0 r0 l3 +n0460 g82 g90 y4 z5 r0.2 x-1.1 p0.6 +n0480 g91 y-2 z2 r0 l4 +n0490 g83 g90 y5 z6 r0.2 x-1.1 q0.21 +n0500 g84 y6 z7 r0.2 x-1.1 +n0510 g85 y7 z8 r0.2 x-1.1 +n0520 g86 y8 z9 r0.2 x-1.1 p902.61 +n0530 g87 y9 z10 r0.2 x-1.1 j0.231 k-0 i-3 +n0535 g91 y1 r0.2 x-1.1 j0.231 k-0 i-3 +n0540 g88 y10 z11 r0.2 x-1.1 p0.3333 +n0550 g89 y11 z12 r0.2 x-1.1 p1.272 + +n1000 m2 (the end) diff --git a/res/nist/expressions.nc b/res/nist/expressions.nc new file mode 100644 index 0000000..68e7c16 --- /dev/null +++ b/res/nist/expressions.nc @@ -0,0 +1,48 @@ +n0010 g21 g1 x3 f20 (expression test) +n0020 x [1 + 2] (x should be 3) +n0030 x [1 - 2] (x should be -1) +n0040 x [1 --3] (x should be 4) +n0050 x [2/5] (x should be 0.40) +n0060 x [3.0 * 5] (x should be 15) +n0070 x [0 OR 0] (x should be 0) +n0080 x [0 OR 1] (x should be 1) +n0090 x [2 or 2] (x should be 1) +n0100 x [0 AND 0] (x should be 0) +n0110 x [0 AND 1] (x should be 0) +n0120 x [2 and 2] (x should be 1) +n0130 x [0 XOR 0] (x should be 0) +n0140 x [0 XOR 1] (x should be 1) +n0150 x [2 xor 2] (x should be 0) +n0160 x [15 MOD 4.0] (x should be 3) +n0170 x [1 + 2 * 3 - 4 / 5] (x should be 6.2) +n0180 x sin[30] (x should be 0.5) +n0190 x cos[0.0] (x should be 1.0) +n0200 x tan[60.0] (x should be 1.7321) +n0210 x sqrt[3] (x should be 1.7321) +n0220 x atan[1.7321]/[1.0] (x should be 60.0) +n0230 x asin[1.0] (x should be 90.0) +n0240 x acos[0.707107] (x should be 45.0000) +n0250 x abs[20.0] (x should be 20) +n0260 x abs[-1.23] (x should be 1.23) +n0270 x round[-0.499] (x should be 0) +n0280 x round[-0.5001] (x should be -1.0) +n0290 x round[2.444] (x should be 2) +n0300 x round[9.975] (x should be 10) +n0310 x fix[-0.499] (x should be -1.0) +n0320 x fix[-0.5001] (x should be -1.0) +n0330 x fix[2.444] (x should be 2) +n0340 x fix[9.975] (x should be 9) +n0350 x fup[-0.499] (x should be 0.0) +n0360 x fup[-0.5001] (x should be 0.0) +n0370 x fup[2.444] (x should be 3) +n0380 x fup[9.975] (x should be 10) +n0390 x exp[2.3026] (x should be 10) +n0400 x ln[10.0] (x should be 2.3026) +n0410 x [2 ** 3.0] #1=2.0 (x should be 8.0) +n0420 ##1 = 0.375 (#1 is 2, so parameter 2 is set to 0.375) +n0430 x #2 (x should be 0.375) #3=7.0 +n0440 #3=5.0 x #3 (parameters set in parallel, so x should be 7, not 5) +n0450 x #3 #3=1.1 (parameters set in parallel, so x should be 5, not 1.1) +n0460 x [2 + asin[1/2.1+-0.345] / [atan[fix[4.4] * 2.1 * sqrt[16.8]] /[-18]]**2] +n0470 x sqrt[3**2 + 4**2] (x should be 5.0) +n0480 m2 diff --git a/res/nist/simple.nc b/res/nist/simple.nc new file mode 100644 index 0000000..31af719 --- /dev/null +++ b/res/nist/simple.nc @@ -0,0 +1,62 @@ +(this program mills “Hello world” between X=0 and X=81 millimeters) +n0010 g21 g0 x0 y0 z50 (top of part should be on XY plane) +n0020 t1 m6 m3 f20 s4000 (use an engraver or small ball-nose endmill) +n0030 g0 x0 y0 z2 +n0040 g1 z-0.5 (start H) +n0050 y10 +n0060 g0 z2 +n0070 y5 +n0080 g1 z-0.5 +n0090 x 7 +n0100 g0 z2 +n0110 y0 +n0120 g1 z-0.5 +n0130 y10 +n0140 g0 z2 +n0150 x11 y2.5 +n0160 g1 z-0.5 (start e) +n0170 x16 +n0190 g3 x13.5 y0 i-2.5 +n0200 g1 x16 +n0210 g0 z2 +n0220 x20 y0 +n0230 g1 z-0.5 (start l) +n0240 y9 +n0250 g0 z2 +n0260 x26 +n0270 g1 z-0.5 (start l) +n0280 y0 +n0290 g0 z2 +n0300 x32.5 +n0310 g1 z-0.5 (start o) +n0320 g2 x32.5 j2.5 +n0330 g0 z2 +n0340 x45 y5 +n0350 g1 z-0.5 (start w) +n0360 x47 y0 +n0370 x48.5 y3 +n0380 x50 y0 +n0390 x52 y5 +n0400 g0 z2 +n0410 x57.5 y0 +n0420 g1 z-0.5 (start o) +n0430 g2 x57.5 j2.5 +n0440 g0 z2 +n0450 x64 +n0460 g1 z-0.5 (start r) +n0470 y5 +n0480 y4 +n0490 g2 x69 r4 +n0500 g0 z2 +n0510 x73 y0 +n0520 g1 z-0.5 (start l) +n0530 y9 +n0540 g0 z2 +n0550 x81 +n0560 g1 z-0.5 (start d) +n0570 y0 +n0580 x79.5 +n0590 g2 j2.5 y5 +n0600 g1 x81 +n0610 g0 z50 +n0620 m2 -- cgit v1.3