← HTMAA

HTMAA 2026 · Final project

Beyond G-code, an interface between AI and machines

The problem. CNC (computer numerical control) machines are driven by G-code, a one-way list of positions and feed rates designed in the 1950s for punched tape. For an AI system trying to manufacture something, G-code is a poor interface:

Much current work asks AI to write G-code. This project goes the other way: it replaces G-code with an interface designed for an intelligent operator.

The idea. I am building a small, low-cost milling machine that measures and models its own physics, and exposes those models through an interface an AI agent can use to:

  1. Observe time-synchronized sensor data and fitted model states.
  2. Query the machine's fitted limits: motor force, acceleration, spindle power, cutting force.
  3. Simulate a plan against the real machine's models before running it: predicted feed, chip load, and force along the path.
  4. Act at the level of intent, giving goals and constraints while the machine's own controller handles fast, real-time motion.
  5. Verify outcomes by comparing measurements against predictions.

The agent plans and supervises; a model-based controller enforces the physics underneath. The agent sits on top of inspectable physical models rather than replacing them.

Why it matters. If an agent can get a new part right on the first attempt through this interface, two things follow: cheap, light machines can run near their true limits instead of behind worst-case margins, and good results stop depending on scarce machinist experience.

Prior work

This project builds on Jake Read's PhD thesis, The End of GCode: Intelligent Modular Machines with Model Based Control (MIT Center for Bits and Atoms, 2026). Jake built an open controller stack (OSAP for networking, PIPES for programming, MAXL for motion control) that runs machines from fitted physical models instead of G-code. He demonstrated a full feedback-based workflow on a 3D printer, and on a milling machine used fitted models to choose motors and motion limits and to estimate cutting forces after a job.

Questions this project answers

  1. What does a machine interface designed for an AI operator need to expose, and can a low-cost mill provide it from its own fitted models?
  2. Given a new part, does an agent using this interface succeed in fewer attempts than the same agent writing G-code?
  3. How close to its real force and power limits can the machine run when the agent plans against fitted constraints?

System design

Layer Plan HTMAA skills
Frame and axes Small three-axis gantry for small parts. Designed for low cost rather than maximum rigidity, since the planner works around the machine's measured limits. CAD, machining, 3D printing, cutting
Motors and drivers Closed-loop steppers using Jake's field-oriented-control stepper boards, which fit their own motor models. Electronics production, embedded programming
Sensing Spindle current sensor for spindle power and torque; optional accelerometer for vibration. Sensors are chosen by what the agent needs to observe. Input devices, electronics design
Network and real-time control Jake's OSAP / PIPES / MAXL stack, with time-synchronized data from every device. Networking and communications
Machine models Fitted motor, axis, spindle power, and cutting force models, built from the machine's own data. Interface and application programming
Agent interface A structured API exposing observe, query, simulate, act, and verify. Plans are checked against model constraints before execution. Interface and application programming
Agent An AI planning agent that receives a part and goal, uses the interface to plan and run the job, and adapts from feedback between operations. Interface and application programming

Evaluation

The same agent is given new test parts (small islands, sharp and rounded corners, dogbones, similar to Jake's test part) under two conditions:

Metrics:

Jake's documented heuristic process (six runs, three failures) is a further reference point for a human-tuned workflow.

Bill of materials

Files