{"data":{"slug":"discovered-e6ea4543585f2cd490aee74988f99b5d11ebd4abb9d2e97b","title":"Carvera AI","summary":"Run a Makera Carvera CNC from a plain-text conversation with an AI agent. The skill provides a playbook and helper commands to teach an agent how to drive the machine safely, including reading initial data, understanding firmware behavior, safety rules, indexing math, probing, leveling, engraving text, and running jobs.","url":"https:\/\/skillshunter.net\/skills\/discovered-e6ea4543585f2cd490aee74988f99b5d11ebd4abb9d2e97b","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-e6ea4543585f2cd490aee74988f99b5d11ebd4abb9d2e97b","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-e6ea4543585f2cd490aee74988f99b5d11ebd4abb9d2e97b.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-e6ea4543585f2cd490aee74988f99b5d11ebd4abb9d2e97b\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before engraving or labeling, ensure the machine is connected and the server is running. Use `tools\/engrave_text.py` to convert text into single-stroke lettering (Hershey Roman Simplex) for engraving. The first deliverable is a G-code program, a ghost program, and a preview.","instructions":"---\nname: carvera-ai\ndescription: Carvera AI \u2014 drive a Makera Carvera CNC (C1, firmware 1.0.3) from plain-text conversation through Carvera Control, a local server with a jog\/indexing web UI, an HTTP API and an MCP server. It starts the server, connects to the machine over Wi-Fi, opens the UI and loads the machine state, saved indexing points, recent UI activity, site rules, the API and the firmware's quirks into context, so the agent can plan, do the math, probe, level, upload and run programs with the user, engrave text with a V-bit, and walks the user through phone and tablet control. Use when the user types \/carvera-ai, or asks to open, connect to, control, jog, probe, index, level or run a job on the Carvera, or to set up phone or tablet control, or to engrave text, a label or a part number, the CNC, the jog UI or \"Carvera Control\". Text after \/carvera-ai is the first task. Always obey the site rules printed by carvera-open (reference setup: the tool never goes below the spoilboard top within R5 of the dowels at X82.5 Y126 and X171 Y37.5, and nothing travels over anchor 1).\n---\n\n# Carvera AI\n\nThe user positions the machine in the **web UI** (jogging, touching off edges, saving indexing\npoints). You read what they did, do the planning and the math, and act on the machine when asked.\nOne server (`127.0.0.1:17916`) owns the machine's single TCP connection. The UI, the `carvera` MCP\nserver and `carvera-api` all go through it, and every action is logged with its source (`ui`, `mcp`,\n`api`, or `remote` for a paired phone or tablet).\n\nProject root: `$CARVERA_CONTROL_HOME`, or the `carvera-ai` repository this skill lives in. The full API\nis in `docs\/API.md`, the firmware notes in `docs\/FIRMWARE-NOTES.md`, the safety rules in `docs\/SAFETY.md`.\n\n## 1. Open (always first)\n\n```sh\ncarvera-open                # start the server if needed, connect, open the UI, print the machine context\ncarvera-open --no-ui        # same without opening the browser (e.g. the UI is already open)\ncarvera-open --no-connect   # don't touch the machine connection\n```\n\nRead everything it prints and keep it in context: connection, state, tool and TLO, machine and work\nposition, G54, last probe, **SITE RULES**, saved points (with notes) and recent activity. Then give the\nuser a short summary: machine state, tool, where it is, which points exist and what they last did. After\nthat, do any task that followed `\/carvera-ai`.\n\n| Exit | Meaning | What to do |\n|---|---|---|\n| 0 | connected (or `--no-connect`) | go |\n| 2 | server would not start | read `data\/server.log` in the project and report |\n| 3 | another controller holds the machine | usually CarveraController. Ask the user to close it (or press its disconnect), then rerun. Never use force without asking |\n| 4 | machine unreachable | it is off, asleep or has a new IP. `carvera-api GET \/api\/discover` listens for its broadcast |\n\n## 2. Act on the machine\n\n**Use the MCP tools if this session has them** (`carvera` server: `machine_status`, `get_activity`,\n`list_points`, `save_point`, `goto_point`, `jog`, `move_to`, `home`, `tool_change`, `probe_z`,\n`set_work_zero`, `send_gcode`, `vacuum`, `stop`, `unlock`, ...). Otherwise use `carvera-api` (same API,\nlogged as source `mcp`). POSTs wait for the job to finish:\n\n```sh\ncarvera-api GET  \/api\/status\ncarvera-api GET  \/api\/activity            # what the user just did: \"ui\" = the computer's browser, \"remote\" = a paired phone\/tablet\ncarvera-api GET  \/api\/points\ncarvera-api POST \/api\/jog   '{\"axis\":\"x\",\"distance\":0.2,\"feed\":300}'\ncarvera-api POST \/api\/move  '{\"x\":181.2,\"system\":\"work\",\"feed\":300}'       # or \"system\":\"machine\"\ncarvera-api POST \/api\/points '{\"name\":\"start\",\"axes\":[\"y\"],\"note\":\"edge\"}'  # capture the current position\ncarvera-api POST \"\/api\/points\/start\/goto\" '{\"mode\":\"direct\"}'               # or \"lift\"; \"include_z\":true\ncarvera-api POST \/api\/tool  '{\"tool\":0}'          # 0 probe, 1-6, -1 empty (putting the probe away = deep stow)\ncarvera-api POST \/api\/probe\/z '{\"max_distance\":30,\"lift\":5,\"set_zero\":true}'\ncarvera-api POST \/api\/zero  '{\"values\":{\"z\":5}}'  # the current position reads Z5\ncarvera-api POST \/api\/gcode '{\"lines\":[\"G91 G1 X-1 F300\"]}'   # raw; G90 restored; offsets re-read after G10\/G92\/M495\ncarvera-api POST \/api\/home\ncarvera-api POST \/api\/stop                        # feed hold + abort; then: carvera-api POST \/api\/unlock\ncarvera-api POST \/api\/vacuum '{\"on\":true,\"power\":80}'    # onboard vacuum; works mid-program; '{\"on\":false}' = off\ncarvera-api POST \/api\/spindle '{\"on\":true,\"rpm\":12000}'  # spindle M3\/M5; ONLY when the user asks\n# While the spindle turns (the firmware reports state Run), jog \/ move \/ goto \/ set zero \/ raw gcode still work\n# (manual control); home, tool change, probe, upload and program runs refuse until it is stopped.\ncarvera-api POST \/api\/disconnect                  # hand the machine back to CarveraController\n```\n\nFailures come back as `{\"state\":\"failed\",\"error\":...}` (HTTP 422). A 409 means another operation is\nrunning: wait, or ask the user.\n\n## 3. Safety (non-negotiable)\n\n- **Site rules first.** `carvera-open` prints `site-rules.txt`. Every program, probe point, leveling\n  grid point and jog must obey them. The reference setup's rules (section 7) are:\n  - **Dowel rule:** the tool head must NEVER travel below Z0, the spoilboard top, within R5 of the\n    dowels (A X82.5 Y126.0, B X171.0 Y37.5, measured from the spoilboard's front-left corner = G54 0,0).\n    Check every program before upload by replaying its moves (lines and arcs) against both zones, with\n    the spoilboard top expressed in that program's work frame. The only exception is the spoilboard\n    program, which cuts those holes.\n  - **Anchor 1:** nothing travels over the anchor block at any height, and no probing there (work\n    X \u221215\u202685 \u00d7 Y \u221215\u20260 and X \u221215\u20260 \u00d7 Y \u221215\u202685). Keep the tool edge 5 mm clear. The firmware's M6 returns\n    to the XY it started from, so never start a tool change while parked over the anchor.\n- Move the machine only when the user asked for **that** motion. Say what you will send before you\n  send it. A standing request (\"jog me there\") covers that one move, not the session.\n- Check the machine's position and tool (`machine_status`) before **every** motion step, including\n  tool changes. The user may have jogged in the UI since you last looked.\n- Never start the spindle unless the user asked for a cut (`\/api\/gcode` refuses `M3\/M4` unless\n  `allow_spindle`; `\/api\/spindle` refuses with the probe or an empty spindle). Spin up at a safe\n  height and let it reach speed (about 15 s; S20000 reads about 16\u201317k rpm on the reference spindle).\n- Near the work, use feed moves and go down in small steps. The `lift` goto mode rapids up to safe\n  machine Z (\u22123) first.\n- Starting a program IS a cut: show the preflight (file, ops, tools, Z0\/XY origin, time, kill-switch\n  envelope, vacuum) and get an explicit \"go\" first.\n- Never delete anything (files on the computer, the machine's SD card or anywhere else) without asking.\n- STOP in the UI or API is a software stop. The machine's E-stop is the real one.\n- Activity with source `remote` is the user on a phone or tablet, probably standing at the machine.\n  Re-read the position and tool before every motion step: they may have moved it.\n\n## 4. Machine facts (Carvera C1, firmware 1.0.3)\n\n- TCP port 2222; discovery broadcasts on UDP 3333 (`name,ip,port,busy`). With no `host` configured,\n  Carvera Control connects to the Carvera it hears.\n- Machine travel: X \u2212371\u20260, Y \u2212250\u20260, Z \u2212135\u20260. Home ends at \u22121, \u22121, \u22121. **+X right, +Y away from the\n  operator, +Z up.** Max feed XY 3000, Z 2000 mm\/min.\n- Tools: T0 = wireless probe (battery in status `W:`), T1\u2013T6 in the rack, T\u22121 = empty. The ATC measures\n  every new tool on the setter (about 60\u201370 s per change).\n- **TLO model:** setting work Z (probe_z with set_zero, or a Z zero) resets TLO to 0, and the current\n  tool becomes the length reference. Later tools get TLO = their setter Z \u2212 the reference tool's setter\n  Z, so the work Z0 holds across tool changes. Never compute G54 = PRB \u2212 TLO by hand.\n- `$H`, `G38.x` and `M400` hold their `ok` until motion ends. `version`, `diagnose`, `config-get`,\n  `ls`, `md5sum` are shell commands that answer without an `ok`. `M6` streams many `ok`s and ends with\n  `Done ATC`.\n- Fusion's `Carvera.cps` post: `M851 S100` \/ `M852` switch the EXTERNAL-control output, NOT the onboard\n  vacuum (`M801 S<pct>` \/ `M802`, or `\/api\/vacuum`). A posted program never turns the onboard vacuum on:\n  add `M801 S80` after the tool change, or switch it with `\/api\/vacuum`. `G28` = go to the clearance\n  position. `T<n>M6` = tool change.\n- Probe battery: judge charge off the coil, not by the docked `W:` reading (it reads high while\n  charging). Don't run a leveling grid below about 3.5 V: a low probe can miss a trigger and drive into\n  the work. A stop or alarm switches the probe charger off; send `M841` afterwards. More in\n  `docs\/FIRMWARE-NOTES.md`.\n\n## 5. Indexing math (touch-offs with the cutting tool)\n\nWhen the user touches off with the **cutting tool**, a saved point is the **tool-centre** position at\nan edge, not the edge. To map a CAM program onto the part:\n1. Find the program's tool-centre coordinate for the same contact (e.g. a contour's Y-run at\n   X = \u22121.587 for a 1\/8\" tool means the wall is at X 0; the end of a corner fillet sits at\n   Y = fillet radius + tool radius).\n2. shift = saved work coordinate \u2212 program tool-centre coordinate, per axis. Apply it to every X\/Y word\n   (I\/J are incremental and stay as they are). For Z, check whether the program's Z0 is the probed\n   surface (read the post header: \"Z Origin \u2026 Stock Top\").\n3. Verify by mapping: the program's contact points must land exactly on the saved machine X\/Y. Then do\n   a ghost pass at the highest Z (in air), then the real run. Shift X\/Y for step-overs; lower only the\n   final pass for a floor clean-up.\n\nSaved points keep machine X\/Y (valid while homing holds) and work Z (valid while G54 Z is unchanged).\n\n## 6. Running programs\n\nThe firmware plays the file from its SD card (tool changes, spindle and vacuum included), so a Wi-Fi\ndrop does not stop the cut. Carvera Control uploads, verifies, starts and watches it:\n\n```sh\ncarvera-api GET  \"\/api\/program\/analyze?path=<url-encoded path>\"     # extents, Z range, tools\ncarvera-api POST \/api\/program\/upload '{\"path\":\"\/abs\/path\/job.cnc\",\"name\":\"job.cnc\"}'   # no spaces in name\ncurl -s -X POST -H 'X-Source: mcp' 127.0.0.1:17916\/api\/program\/run \\\n     -d '{\"path\":\"\/abs\/path\/job.cnc\",\"name\":\"job.cnc\"}'        # no ?wait: returns the job id at once\ncarvera-api GET  \/api\/job\/<id>                                    # progress: lines, percent, state\n```\n\n- Upload is XMODEM-8K, then the machine's `md5sum` must match. Run refuses unless the stored file's md5\n  matches the local file.\n- Kill switch: with the spindle on and no tool change running, a tool below work Z3 outside the\n  program's XY extents + 3 mm, or below its lowest Z \u2212 0.5, triggers feed hold + abort.\n- Leveling: CarveraController's auto-leveling only covers the toolpath bounding box and the firmware\n  applies NO compensation outside the probed grid. For full control, probe a grid with `M495`, read it\n  with `M375.1` and level the program offline with `tools\/leveling\/` (see `docs\/LEVELING.md`).\n- **Probe stow:** putting the probe away through `\/api\/tool` plunges 2 mm below the firmware's drop\n  (`probe_stow_extra_mm`) so it seats on its charger. A `T<n>M6` inside a program still drops it the\n  firmware's way, so after a leveling grid, stow it with `\/api\/tool {\"tool\":-1}` BEFORE starting the\n  run, and check that it charges.\n- Watching a run: switch the vacuum on only while the spindle runs (never after the program's own\n  `M802` at the end).\n\n## 7. Site rules and spoilboard (reference setup; edit `site-rules.txt` for yours)\n\n- **Spoilboard:** 335 \u00d7 225 \u00d7 6.35 mm PVC laid on the original Makera bed, pushed into the anchor 1\n  corner. Its front-left corner is 0,0 = G54 X0 Y0 (the anchor 1 inner corner). Its top surface is Z0.\n- **Top surface height:** on the reference machine, machine Z \u2212103.12 with the probe as the length\n  reference. When G54 Z is probed on top of stock, the spoilboard top in work Z is\n  (spoilboard machine Z) \u2212 G54 Z. With a CAM Z0 at the stock top, it is \u2212(stock thickness).\n- **Holes:** 46 \u00d7 \u00d85.2 bolt holes on the Makera C1 bed pattern, plus **dowel A X82.5 Y126.0 and dowel B\n  X171.0 Y37.5, \u00d84.1** (4 mm dowels). All 7.1 deep. Files: `machines\/makera-carvera-c1\/spoilboard\/`\n  (drawing PDF, program, layout PNG, README with a copy-paste prompt). Generators:\n  `tools\/spoilboard_holes.py`, `tools\/spoilboard_drawing.py`.\n- **Dowel rule** and **anchor 1 rule**: see section 3. A through-cut that crosses a dowel zone must be\n  refused or re-planned before upload.\n\n## 8. From a text conversation to a finished part\n\nWith an Autodesk Fusion MCP server connected as well, the whole chain can run from conversation:\nmodel the part in Fusion, create the CAM setup and toolpaths, post with `Carvera.cps`, fix the vacuum\ncodes, check the program against the site rules, index the stock (probe Z, touch-offs, saved points),\nlevel if needed, upload, preflight, and run it on the machine with the user's go. The steps and the\npitfalls (Fusion Personal limits, the vacuum codes, the probe stow) are in `docs\/FUSION-WORKFLOW.md`.\n\n## 9. Phone and tablet setup (walk the user through it)\n\nWhen the user asks to control the machine from a phone or tablet (\"set up phone control\", \"use it from\nmy iPad\"), follow these steps. The user's guide is `docs\/PHONE.md`; point them to it at the end.\n\n1. **Check the server has it:** `carvera-api GET \/api\/remote`. \"unknown endpoint\" means the running\n   server is older than the code: restart it (stop the server process, then `carvera-open --no-ui`),\n   but only while the machine is Idle with no job running, and tell the user first.\n2. **Turn it on** (the user's request covers this): `carvera-api POST \/api\/remote '{\"on\":true}'`.\n   A 409 \"cannot listen on port\" means the port is taken: set `\"remote_port\"` in `data\/config.json` and\n   restart.\n3. **Give the user the address and the code** from the reply. `urls` lists the `.local` name first (it\n   survives IP changes) and the IP address as the fallback. Read `code` as two groups (\"123 456\"). Tell\n   them: same Wi-Fi as this computer, open the address in Safari or Chrome, enter the code, tap Pair.\n4. **Wait for the pairing.** Poll `carvera-api GET \/api\/remote` every few seconds (up to about 3\n   minutes) until `devices` gains an entry. `GET \/api\/activity` shows `remote pair` on success and\n   `remote pair:failed` on a wrong code. Codes change after every pairing and after 5 wrong tries, so\n   on a failure read them the current `code`.\n5. **Confirm by name** (\"Paired: iPhone\"). Then the Home Screen:\n   - iPhone\/iPad Safari: Share \u2192 Add to Home Screen. The icon may ask for a code once (iOS keeps its\n     cookies apart from Safari); read them a fresh `code`.\n   - Android Chrome: \u22ee \u2192 Add to Home screen.\n6. **Tell them the essentials.** This computer keeps the machine connection, so it must stay awake with\n   Carvera Control running. STOP on the phone is a software stop; the E-stop is the real one. Raw\n   G-code and programs stay on the computer. Turn access off in the Phone dialog (or ask you) when done.\n\n**If the phone cannot open the address:**\n- Check `curl -s -o \/dev\/null -w \"%{http_code}\" http:\/\/<ip>:<port>\/` from this computer. 200 means the\n  listener is up and the problem is between the phone and the computer.\n- Same network? Guest Wi-Fi often isolates devices. Some Android phones don't resolve `.local`: use the\n  IP address.\n- Firewall. macOS: `\/usr\/libexec\/ApplicationFirewall\/socketfilterfw --getglobalstate`; if it is on, the\n  user clicks Allow for Python or adds it in System Settings \u2192 Network \u2192 Firewall \u2192 Options. Windows:\n  allow Python on private networks. Linux: `sudo ufw allow <port>\/tcp`. Ask before changing firewall\n  settings yourself.\n- The computer went to sleep or Carvera Control stopped: start it again (`carvera-open --no-ui`).\n\n**Rules:** turn phone access on or off, and forget devices (`POST \/api\/remote\/forget '{\"id\":...}'`, no\nid = all), only when the user asks. A phone cannot reach `\/api\/remote`, raw G-code or programs (403),\nwhich is by design.\n\n## 10. Engraving text (V-bit)\n\nWhen the user asks to engrave, mark or label something (\"engrave VISE 1 here\", \"put the part number on\nit\"), do not send them to CAM software. `tools\/engrave_text.py` turns text into single-stroke lettering\n(Hershey Roman Simplex, all printable ASCII) and writes the engraving program, a ghost program and a\npreview. The full guide is `docs\/ENGRAVING.md`.\n\n**1. Ask first.** Use one question round that covers everything the user hasn't already said:\n- **Text**, including any line breaks.\n- **Size**: the capital height in mm.\n- **Format**: where the text attaches to the current tool position (or to a point they name).\n  - Horizontal: left \/ center \/ right. Vertical: top \/ middle \/ baseline \/ bottom (\"centered top to\n    bottom\" = middle).\n  - For several lines: their alignment.\n  - Rotation, if the text runs along Y.\n- **Depth**: the final depth and the step per pass. 0.1 mm passes are a good default in aluminium.\n- **Tool**: which slot, the bit type and angle (30\/60\/90\u00b0 V-bit, or a small end mill), and the tip\n  width if it is flat-tipped. Also the speeds; the defaults are slow: 150 mm\/min, plunge 40, 18 000 rpm.\n  \"Half speed\" means half the feed, not half the rpm (less rpm makes each tooth take a bigger bite on a\n  V-bit).\n\n**2. Preview before any motion.** Read status (tool, position) and run the generator with the anchor\nat the current work XY:\n```sh\npython3 \"$CARVERA_CONTROL_HOME\/tools\/engrave_text.py\" \"VISE 1\" --height 6 --anchor left-middle \\\n  --x <work X> --y <work Y> --depth 0.8 --step 0.1 --bit-angle 60 --tool 6 --feed 150 --plunge 40 \\\n  --out text.cnc --ghost text_ghost.cnc --preview text.png\n```\n- Look at the PNG and show it to the user.\n- Check the printed work extents (\u00b1 half the groove) against the site rules.\n- The groove is tip + 2\u00b7depth\u00b7tan(angle\/2). The generator warns when it is over 22% of the capital\n  height.\n\n**3. Probe the surface.**\n- Lift straight up to machine Z \u22123 BEFORE swapping a short bit for the probe. The probe is usually\n  longer, so at jog height it would hit the part.\n- Load T0 and feed down to about 10 mm above the surface.\n- `probe_z` with `set_zero` at one end of the text.\n- Move at Z +10 to the other end and `probe_z` with `\"set_zero\": false`. For a 2-D block, probe a\n  third point off that line.\n- Pass the readings as `--surface \"x1,y1,0;x2,y2,dz2\"`. 1 point = constant, 2 = slope along the line,\n  3+ = plane. Every pass then stays at the same depth below the real surface.\n\n**4. Stow the probe, reload the bit, generate the final files.**\n- Stow with `\/api\/tool -1` (deep stow) and check that the docked voltage rises.\n- Load the bit through `\/api\/tool`; the tool setter measures it against the probe.\n- Re-run the generator with `--surface`. G54 X\/Y stays as it was; only Z0 moves to the engraving\n  surface. Tell the user, because the next part needs a fresh Z probe.\n\n**5. Ghost first, then cut.**\n- Upload both files, then offer the ghost pass: the same strokes 1 mm up, spindle and vacuum off. Run\n  it if the user wants it.\n- Show the preflight: text, size, anchor, extents, groove, passes, speeds and time.\n- On \"go\": `M370`, vacuum on, run, watch, and switch the vacuum off at the end.\n\nThe program has no tool change, lifts to machine Z \u22123 before any XY move, rapids to 0.3 mm above the\nsurface and plunges from there, and never writes nested comments. Tests: `tests\/test_engrave.py`.\n","use_cases":["Engraving text on a part using single-stroke lettering","Setting up remote control of the machine from a phone or tablet","Running and managing CNC jobs through a conversation with an AI agent"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/BlinkingSun\/carvera-ai\/blob\/5c0a7e60746ae7f7b3f2dbee66f8b43a8a018ad0\/skill\/carvera-ai\/SKILL.md","source_commit":"5c0a7e60746ae7f7b3f2dbee66f8b43a8a018ad0","license":null,"version":null,"listing_approved_at":"2026-12-03","created_at":"2026-12-02T06:53:44.000000Z","updated_at":"2026-12-03T16:19:55.000000Z","seo_title":"Carvera AI - Run a CNC Machine with an AI Agent","seo_description":"Carvera AI allows you to control a Makera Carvera CNC machine through a plain-text conversation with an AI agent. It includes a local server, a skill playbook, and tools.","seo_keywords":["Carvera AI","CNC machine control","AI agent for CNC","Makera Carvera C1","text engraving","remote machine control"]}}