计算机使用智能体分类English
R07.07.01.02 · 任务小类

G代码编写与校验

G-code authoring & verification

Write or fix G-code and verify it in an NC simulator.

20 条本项目编写的提案 · 分类 v1.1 · 新增基准运行 0 次。下方验证方式与部分得分规则是设计,不是执行结果。

典型应用
CAMotics · LinuxCNC · text editor
小类 GUI 需求标签
CL · CLI 足够

任务提案 · 20

展开查看完整原文与建议检查方式;两种界面均保留提案英文原文。

R07.07.01.02-T01 Hand-write G-code for a rectangular pocket with step-downs and stepover

原始指令

Write out/pocket.ngc (Fanuc/LinuxCNC-compatible, metric, G54) that mills a 50×30×5 mm pocket centred at X0 Y0 in 6061 stock (top Z0) with a Ø6 flat endmill: 1.0 mm step-downs, 40% stepover, helical or ramp entry (no plunge), climb finish pass 0.2 mm on walls, S9000 F900. Retract to Z10 at end, M30.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

CAMotics headless sim: machined volume vs target pocket Hausdorff ≤0.1 mm, no material removed outside pocket; parser checks: max Z step 1.0, no vertical plunge (G1 Z-only below Z0), stepover ≤2.4 mm, climb direction on finish, spindle/feed set before cutting.

建议部分得分

40% pocket geometry; 20% step-down/stepover; 30% entry & finish pass; 10% safe start/end

R07.07.01.02-T02 Convert an absolute G90 program to incremental G91 with an identical path

原始指令

Convert fixtures/bracket_abs.ngc (G90, 214 lines incl. arcs with I/J) to out/bracket_inc.ngc using G91 for all motion while preserving the toolpath exactly. Keep arc centres incremental (as they already are), the same feeds and the same start point.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · LinuxCNC
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
2 / 5

建议验证方式

LinuxCNC rs274 interpreter traces both programs: canonical motion endpoints equal within 0.0005 mm; output contains G91 and no G90 motion; feeds equal.

建议部分得分

70% identical canonical path; 15% G91 throughout; 15% feeds preserved

R07.07.01.02-T03 Find and fix three errors in a lathe program

原始指令

fixtures/lathe_pin.nc (Fanuc lathe, diameter mode) has three defects: a feed move without F before the first cut, a G17 plane select where G18 is required for G02/G03, and a rapid move that crosses the stock. Fix them with minimal edits and list the line numbers and fixes in out/fixes.txt.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
2 / 5

建议验证方式

Diff limited to ≤6 lines; grader's turning sim: no rapid inside stock envelope; all arcs interpreted in G18; feed defined before first G01; final profile equals reference ±0.01 mm; fixes.txt names 3 line numbers.

建议部分得分

75% defects fixed (25 pts each); 15% profile unchanged; 10% fixes.txt

R07.07.01.02-T04 Write a parametric bolt-circle drilling subroutine with O-words

原始指令

Write out/boltcircle.ngc for LinuxCNC: an O-word subroutine o100 taking PCD, hole count, start angle, depth and peck as parameters, calling G83 peck drilling at each hole; main program drills 8× holes on PCD 80 mm at 22.5° start, depth 12 mm, peck 2 mm, and 6× holes on PCD 40 at 0°, depth 8 mm.

平台
lin · Linux
应用
LinuxCNC · text editor
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

LinuxCNC sim (axis-less interpreter) trace: 14 holes at correct XY ±0.001 mm; G83 with R/Q/Z correct; subroutine used (o100 sub/call present) not unrolled; grader also calls o100 with hidden params via a test harness.

建议部分得分

40% hole positions; 20% peck cycles; 25% real subroutine reusable; 15% hidden-param call

R07.07.01.02-T05 Program an outside contour with cutter compensation and lead-in/lead-out

原始指令

Write out/cam_plate.ngc that profiles the outside of the plate in fixtures/cam_plate.dxf (lines and arcs) with a Ø10 endmill using G41/G42 cutter radius compensation from the part geometry, a tangent arc lead-in and lead-out longer than the tool radius, climb milling, depth 6 mm in 2 passes.

平台
lin · Linux
应用
LinuxCNC · text editor
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

LinuxCNC interpreter with tool table Ø10: no comp errors; compensated path offset 5 mm from part ±0.01; part profile cut within 0.02 mm (sim); climb direction; lead arcs radius >5 mm.

建议部分得分

40% compensated geometry; 20% leads valid; 20% climb & depths; 20% runs without interpreter errors

R07.07.01.02-T06 Thread-mill an internal M30×2 thread with helical interpolation

原始指令

Write out/threadmill.ngc for LinuxCNC that thread-mills an internal M30×2 right-hand thread, 20 mm deep, in a Ø28 pre-drilled hole at X0 Y0, using a single-point thread mill (cutting Ø16, tool 7), bottom-up climb milling, helical arc-in and arc-out, two radial passes (70%/30%).

平台
lin · Linux
应用
LinuxCNC · text editor
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Interpreter trace: helical G02/G03 with pitch 2 mm per revolution; direction gives RH thread bottom-up climb; final major diameter of swept path 30.0±0.02 accounting tool radius; depth 20; two radial passes; arc-in tangent.

建议部分得分

35% pitch/handedness; 30% major diameter; 15% passes; 20% entry/exit and depth

R07.07.01.02-T07 Write a G71/G70 roughing and finishing cycle for a turned profile

原始指令

From fixtures/turned_part.pdf (profile with tapers, a radius R4 and a shoulder) write out/turn.nc (Fanuc 0i-T style): G71 roughing (DOC 1.5 mm, retract 0.5, U0.4 W0.1 allowances) and G70 finishing with the profile in P/Q blocks, G96 constant surface speed 200 m/min, G50 max 2500 rpm.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader Fanuc-lathe interpreter expands G71/G70: final profile within 0.01 mm of drawing; G71 params correct; P/Q blocks monotonic for Type I; G96/G50 present.

建议部分得分

45% final profile; 25% cycle parameters; 15% Type-I validity; 15% CSS settings

R07.07.01.02-T08 Generate G-code to engrave text along an arc with a single-line font

原始指令

Write a script that converts the string 'FRONTIER-2026' in the Hershey 'futural' single-stroke font to G-code engraving it along an arc of radius 60 mm centred at X0 Y0, text centred at 90°, cap height 6 mm, depth 0.3 mm, V-bit tool 3, and write out/engrave.ngc.

平台
lin · Linux mac · macOS win · Windows
应用
Python · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Interpreter trace: strokes match reference rendering after arc-mapping (Chamfer distance ≤0.05 mm); depth 0.3; retracts between strokes ≥1 mm; baseline radius 60±0.05; centred at 90°±0.5°.

建议部分得分

40% glyph geometry; 25% arc mapping; 20% depth/retracts; 15% centring

R07.07.01.02-T09 Reorder a drilling program to cut air-move time by a quarter

原始指令

fixtures/panel_drill.ngc drills 160 holes in file order with full Z50 retracts between all holes. Rewrite it as out/panel_drill_opt.ngc that drills the same holes with the same cycles but reorders them (nearest-neighbour + 2-opt or better) and uses R-plane retracts (G99, R2) within each tool group, cutting total rapid time by ≥25% at 15 m/min rapids.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · Python
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Interpreter trace: same multiset of holes/depths/cycles; rapid time ≤75% of original; no rapid at Z<2 across clamp zones defined in fixtures/clamps.json.

建议部分得分

30% same holes & cycles; 50% rapid-time reduction (scaled); 20% clamp-safe retracts

R07.07.01.02-T10 Write a LinuxCNC probing routine that finds a corner and sets G54

原始指令

Write out/probe_corner.ngc for LinuxCNC that, starting above the stock near its front-left corner, uses G38.2 probing moves to touch the left face and front face (with backoff and slow re-probe), computes the corner accounting for a Ø2 stylus, and sets G54 X/Y with G10 L20. It must abort with an error message if a probe fails to trip.

平台
lin · Linux
应用
LinuxCNC
交互表面
term · 终端 desk · 桌面 GUI
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
5 / 5

建议验证方式

Run in LinuxCNC sim config with simulated probe (HAL comp tripping at hidden stock faces, 3 random offsets): G54 X/Y equals true corner ±0.01 mm; failure case (missing face) triggers abort; re-probe at slower feed present.

建议部分得分

25% probing moves; 40% correct G54 for hidden offsets; 15% stylus comp; 20% failure handling

R07.07.01.02-T11 Port a Grbl router program to LinuxCNC dialect

原始指令

fixtures/sign_grbl.gcode was written for Grbl 1.1 (laser-mode M4, $-commands, no tool table, G64 absent). Convert it to out/sign_linuxcnc.ngc for a LinuxCNC router: remove $ lines, map spindle to M3 with S scaling 0-1000→0-18000 rpm, add G64 P0.02, T1 M6 with G43, %-delimiters as required, preserving all motion.

平台
lin · Linux
应用
LinuxCNC · text editor
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

LinuxCNC interpreter runs without error; motion trace equals Grbl reference parse ±0.001 mm; S values scaled; G64 P0.02 and tool change present; no $-lines.

建议部分得分

40% motion preserved; 20% spindle mapping; 20% tool/G64; 20% runs clean

R07.07.01.02-T12 Generate trochoidal slotting G-code within an engagement limit

原始指令

Write a generator that outputs out/troch_slot.ngc to cut a 10 mm wide, 60 mm long, 12 mm deep straight slot with a Ø6 endmill using trochoidal (circular) passes at full depth, keeping radial engagement ≤20% of tool diameter, F 1500, with smooth arc transitions. Report the max engagement computed by your script.

平台
lin · Linux mac · macOS win · Windows
应用
Python · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

Grader voxel engagement analysis on the path: max radial engagement ≤1.2 mm (+5%); slot geometry within 0.05 mm; no full-width slotting moves; path continuous (G2/G3 only in cut).

建议部分得分

40% engagement limit; 35% slot geometry; 25% continuity/smoothness

R07.07.01.02-T13 Generate a 3D raster finishing path from a heightmap with a scallop limit

原始指令

From fixtures/relief.png (512×512, 0-255 → 0-8 mm depth over 100×100 mm) generate out/relief.ngc finishing raster with a Ø3 ball-nose, stepover chosen so scallop height ≤0.02 mm on flat regions, accounting for ball-tool offset (no gouging of steep regions), 0.05 mm tolerance.

平台
lin · Linux mac · macOS win · Windows
应用
Python · CAMotics
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
4 / 5

建议验证方式

CAMotics sim: resulting surface vs heightmap: no gouges deeper than 0.02 mm anywhere; mean abs error ≤0.05 mm; stepover ≤ 2√(2·R·h) for h=0.02.

建议部分得分

40% no gouging; 35% accuracy; 25% stepover/scallop

R07.07.01.02-T14 Configure a simulated LinuxCNC mill and prove a program within soft limits

原始指令

Create a LinuxCNC sim config out/mymill/ (INI + HAL, 3 axes, mm, X 0-400 Y 0-300 Z -120-0 soft limits, max vel 250 mm/s, tool table with T1-T4 from docs/tools.csv). Run fixtures/job_17.ngc in it headless and fix the one program line that violates a soft limit by changing the work offset only.

平台
lin · Linux
应用
LinuxCNC
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP08 · 应用 / 系统状态
条件
未声明
提案难度
3 / 5

建议验证方式

Grader launches config with linuxcncrsh: loads, homes, runs job without limit errors; INI values as specified; tool table entries exact; program diff only G54 offset (G10) lines.

建议部分得分

35% config valid; 20% tool table; 30% program runs within limits; 15% minimal fix

R07.07.01.02-T15 Fix a toolpath that collides with a fixture clamp in CAMotics

原始指令

fixtures/vise_job.ngc collides with the clamp modelled in fixtures/vise_job.camotics (clamp at X40-60 Y-5-5 Z0-15). Edit the program so all moves clear the clamp by ≥3 mm (raise linking moves or re-route) without changing the cutting moves on the part. Save out/vise_job_fixed.ngc.

平台
lin · Linux mac · macOS win · Windows
应用
CAMotics · text editor
交互表面
term · 终端 desk · 桌面 GUI
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令 vis · 视觉判断
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Swept tool+holder volume clearance to clamp ≥3 mm; cutting segments (G1/G2/G3 with Z<0.5) unchanged; final part identical in sim.

建议部分得分

50% clearance; 35% cutting moves unchanged; 15% part identical

R07.07.01.02-T16 Write a G-code linter that checks feeds, spindle and travel limits

原始指令

Write out/nclint.py that parses RS274 programs and reports: cutting moves without spindle on, F missing/zero, S above tool max (from docs/tools.csv), moves beyond machine envelope, arcs with radius mismatch >0.01 mm, and G41/G42 without matching G40. Run it on the 10 programs in fixtures/nc_batch/ and write out/lint_report.json.

平台
lin · Linux mac · macOS win · Windows
应用
Python
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

lint_report.json findings vs seeded defects (37 across 10 files): recall ≥0.9, precision ≥0.9 by (file, line, rule); linter also run on 5 hidden programs.

建议部分得分

50% recall/precision on given set; 35% hidden set; 15% report schema

R07.07.01.02-T17 Write a Fanuc Macro B parametric rectangular-pocket routine

原始指令

Write out/O9010.nc, a Fanuc Macro B custom macro called as G65 P9010 with arguments A (length), B (width), C (depth), D (tool dia from #13xxx offset), E (step-down), F (feed), that clears a rectangular pocket centred at the current position with spiral-out stepover 50% D and alarms (#3000) on invalid inputs (D ≥ min(A,B)).

平台
lin · Linux mac · macOS win · Windows
应用
text editor · Fanuc NCGuide
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
5 / 5

建议验证方式

Grader Macro-B interpreter runs 6 calls with hidden arguments: pocket volume within 0.05 mm of target each; step-down ≤E; stepover ≤0.5D; invalid-input call raises #3000 alarm.

建议部分得分

50% hidden calls correct; 20% parameters respected; 15% alarm; 15% spiral pattern

R07.07.01.02-T18 Wrap a 2D engraving onto a cylinder using a rotary A axis

原始指令

Convert fixtures/pattern.dxf (closed curves on a 94.25×40 mm canvas) into out/wrap.ngc for a 4-axis LinuxCNC mill with A rotating about X: wrap the Y dimension around a Ø30 cylinder (Y→A degrees), engrave 0.4 mm deep with Z referenced to cylinder top, and keep feed in inverse-time mode (G93) for combined moves.

平台
lin · Linux
应用
LinuxCNC · Python
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
5 / 5

建议验证方式

Interpreter trace unwrapped (A→arc length) matches DXF within 0.05 mm (Chamfer); depth 0.4 relative to radius 15; G93 with valid F on all A moves; full 360° maps to 94.25 mm.

建议部分得分

40% unwrapped geometry; 25% depth; 25% inverse-time feeds; 10% scale

R07.07.01.02-T19 Identify which of five programs produces the target part by simulating them

原始指令

fixtures/candidates/ holds five NC programs and target_part.stl. Use CAMotics (GUI or CLI) with stock 60×60×20 and tool table fixtures/tools.json to simulate each, compare with the target and write the matching program name and a one-line reason for each rejected one in out/answer.json.

平台
lin · Linux mac · macOS win · Windows
应用
CAMotics
交互表面
desk · 桌面 GUI term · 终端
GUI 需求 · 任务设定
HY · 混合
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
vis · 视觉判断 code · 代码与命令
工作产物
WP12 · 答案 / 决策
条件
未声明
提案难度
2 / 5

建议验证方式

answer.json correct program; rejection reasons match key categories (wrong depth, mirrored, missing hole, wrong tool) for ≥3/4.

建议部分得分

70% correct program; 30% rejection reasons

R07.07.01.02-T20 Correct feeds and speeds to a chip-load spec for each operation

原始指令

fixtures/housing_ops.ngc uses six tools on 304 stainless. Using the vendor cutting data in docs/feeds_304.pdf (SFM and chip load per tooth by diameter) and tool data in docs/tools.csv, recompute S and F for every cutting block (respect 12,000 rpm max) and write out/housing_ops_fixed.ngc plus out/calc.csv.

平台
lin · Linux mac · macOS win · Windows
应用
text editor · Python
交互表面
term · 终端
GUI 需求 · 任务设定
CL · CLI 足够
GUI 需求 · 普通权限
CL · CLI 足够
交互原语
code · 代码与命令
工作产物
WP06 · 代码 / 工程
条件
未声明
提案难度
3 / 5

建议验证方式

Each tool's S within 1% of SFM-derived rpm (clamped at max); F = rpm × z × chipload ±1%; motion unchanged; calc.csv values consistent.

建议部分得分

40% spindle speeds; 40% feeds; 20% motion unchanged & calc table

已有研究映射

当前映射未给此小类指定基准参考。

同工作流族的小类