[Community fork] Onefinity BB Buildbotics Controller firmware with corner/center probing and an on-controller cut depth preview (use at your own risk)

Who I am, and what this is not
I’m just some guy with a Onefinity. I don’t do this for a living, and this isn’t an official or supported project. I built these changes for my own shop and my own jobs, then decided to share them in case they’re useful to someone else.

Please read before installing

  • Use this at your own risk. Firmware runs your machine. A bug could cause unexpected motion, crashes, ruined stock, broken tooling, damaged equipment, or injury.
  • I test on my own machine, with my own setup and my own workflow. I don’t do exhaustive testing, and I can’t test for setups or usage patterns that aren’t mine.
  • It’s provided as is, with no warranty of any kind. I’m not responsible for any damage or loss from using it.
  • It’s not affiliated with or endorsed by Onefinity or the Buildbotics project.
  • Installing third-party firmware may affect your support or warranty with Onefinity. That’s your call.
  • Back up your configuration first, and keep the official firmware file handy so you can roll back.
  • On your first runs, do an air cut with the spindle or router off. Stay at the machine with your hand near the e-stop.

What’s different from the stock firmware (v1.6.7)

1. Probing: any corner, or the center of your stock (Probe XYZ and a new Probe Center button)

  • Probe XYZ now asks which corner of the stock you’re probing: front-left, front-right, back-left or back-right. Front-left generates the same commands as stock. The other three mirror the X and/or Y directions and swap the block’s X/Y faces when it’s rotated 90°.
  • Probe Center is a new button on the control page, for the standard non-rotary probe block. It asks which side you’re probing.
    • Side A is the full center probe. It sets X, Y and Z. It probes the front-left corner, then the back-right corner with the block rotated 180°. X0/Y0 is set at the midpoint of the contacts, so the block dimensions and the bit diameter cancel out of the result.
    • Side B is for the second side of a part after an end-for-end flip. It sets X and Z only and keeps your Y. If the long edge sits against a fixed jaw, Y should come from the jaw, not from re-probing the far edge. It probes the front-left and front-right corners, and it corrects for the front-right block being rotated 90°.
  • For the second placement of the center probe, you jog the bit over the second block corner yourself, the same way you do for the first. Both placements come from one shared sequence, so they’re exact mirrors of each other. The second placement does its own Z touch on the block. If it differs from the first by more than 0.5 mm, it lifts and stops without moving sideways or changing your origin. That check caught the failure where the bit comes down on the stock instead of the block.
  • The center probes save the measured stock half-length and half-depth as #<_ofprobe_hx> and #<_ofprobe_hy>. A G-code program can use those instead of a typed stock size. I use them for an automatic end skim.
  • The stock-size fields work with the touchscreen keyboard, and they accept input like 350, 350mm or 350,5.
  • Each button remembers its last choice.

2. Mist coolant safety for paused jobs (Load 1 / M7)
Stock firmware leaves the mist output on through a pause (M0, M1, or the Pause button). Nothing switches it off except M9 or the end of the program, so a paused job keeps spraying. This fork turns the mist off when the job pauses. When you resume, it turns the mist back on and waits 2 seconds so mist is already flowing before the cutter moves. Stop and e-stop leave the mist off. This only affects you if you run a mister from the Load 1 output. It’s the least battle-tested part of the fork. Check it on the bench before you trust it on a job.

3. Dark mode colors
A small tweak to the dark theme colors. It’s cosmetic.

4. Depth view (new in 1.7.0)
There’s a new button in the path viewer toolbar, a cube icon. It replays the program’s planned tool path against a simulated block of stock and shows a depth-colored map of what will be cut. You can scrub through the program or press Play. You enter the tool diameter (flat end mill or V-bit) and the stock top Z. It also warns if a rapid move would run below the stock surface.

I made it because the preview you get on a PC wasn’t good enough for me. I wanted to check what a program would cut at the machine before running it.

It’s a simulation of the planned path, not a guarantee. It assumes the stock top Z, the tool shape, and the work offsets you enter. It doesn’t model deflection, tool wear, fixtures, or clamps. Don’t rely on it as your only check. Simulate in your CAM software and do an air cut as well.

Install
It’s the usual Onefinity .tar.bz2 firmware package. Install it from the controller’s Firmware Update page, like any other firmware file. [Link to release/download]

Source
mikejsmith1985/onefinity-firmware. The code is open, so you’re welcome to read it, check it, and tell me what I got wrong.

Support and feature requests
I’m happy to hear ideas, especially from people who use their CNC in ways or at volumes I don’t. I’m glad to help implement useful features when I have time. But I can’t promise timelines, I can’t promise fixes, and I won’t be testing every release beyond what I need for my own work. If you find a bug, a clear report helps: firmware version, what you did, what happened, and the controller log if you can. If you want to fix something yourself, pull requests are welcome.

Make good chips, and stay safe.

Keep in mind, this is not an officially sanctioned firmware from Onefinity. Use at your own risk. May void your warranty or make your machine inoperable.

After posting, I got a second wind about working on this and built a React UI today.

I’ve not yet tested it on the CNC screen but the original UI is still in tact just use the “try new UI” Button from the slide out menu:

Click “Classic UI” just above the jog controls to go back to the original ui

Thanks for sharing. I have a related question you might be able to help me with since you obviously know how to program the controller. I have written some modifications to the Vetric VCarve post processor that adds a comment block listing out the material dimensions, the bit to use, and the probe location. I’ve asked the folks at OneFinity and Buldbotics if there is a way to include an escape sequence that will modify the code display to show those notes in a different color. For example, show the material dimensions in blue, show the bit selection and speed in red, show the XYZ zero position in green, etc. Switch display color back to black for the machine code. If you know how to do that I would be very grateful if you could tell me how to do it.

Thank you!

Rex

Hi Rex,

Good question. I dug into the controller’s source code to answer it properly.

Why the factory firmware can’t do it

The G-code viewer on the stock Onefinity firmware shows every line as plain text. Before displaying a line it converts any special characters to harmless text, so there is no escape sequence, tag, or setting that can change a line’s color. That’s why Onefinity and Buildbotics couldn’t point you to one. It needs a change to the firmware itself.

Option 1: Use my firmware (version 1.26.0)

I’ve added this as a feature you can turn on and off.

  1. Download onefinity-1.26.0.tar.bz2 from Releases · mikejsmith1985/onefinity-firmware · GitHub. Use that file, not the “Source code” zips, and don’t extract it.
  2. On the controller, go to Admin > General and use Upgrade from file. Don’t do this during a job, because the controller restarts.
  3. Go to Settings > G-code and turn on Colored comments. It’s off by default.

Note that my firmware uses a redesigned interface, and the color feature is in that interface.

To color a line, start a comment with @ and a color name. The tag is hidden on screen:

(@blue Material: 24.0 x 12.0 x 0.75 in)
(@red Bit: 1/4" downcut spiral, 18000 RPM)
(@green Zero: front-left corner, top of material)
G21
G90
...
  • One line: the tag colors only that line. Everything after it stays the normal color, so you don’t need a “switch back” command.
  • Several lines: put a tag on its own line, like (@green). Every line after it is colored until (@end).
  • Trailing comments: a tag in a comment at the end of a G-code line colors the whole line, like G1 X10 Y10 (@orange first cut).
  • Colors: blue, red, green, yellow, orange, purple, cyan, pink, gray, white, or a hex code like (@#ff8800 ...).

For your VCarve post, just add the tag to the start of each comment line it already writes. For example, if a line in your post processor writes "( Material: ... )", make it "(@blue Material: ... )".

The tags are ordinary G-code comments, so the controller ignores them when cutting. Your files will run the same on stock firmware. The tags will just show up as plain text there.

Option 2: Add it to your own copy of the firmware

If you’d rather keep the stock interface, the change is small. In the stock firmware, the G-code display is built in src/js/gcode-viewer.js. Inside the function that loads the file, find this block:

js

const lines = escapeHTML(text.trimRight())
  .split(/[\r\n]/)
  .map((line, i) => `<li class="ln${i + 1}" contenteditable="true"><b>${i + 1}</b>${line}</li>`);

Replace it with:

js

const lines = tagLines(escapeHTML(text.trimRight()).split(/[\r\n]/));

Then add this near the top of the file, after the escapeHTML function:

js

// Comments that start with @color are shown in that color, e.g. (@blue Material: ...)
const TAG_COLORS = { blue: "#1f5fd1", red: "#c62828", green: "#2e7d32", orange: "#e65100", purple: "#6a1b9a", gray: "#777777" };
const TAG = /(\(\s*|;\s*)@(#[0-9a-f]{3}(?:[0-9a-f]{3})?|[a-z]+)\b([^)]*)/i;
const RESET = ["end", "default", "black", "normal"];

function tagLines(lines) {
  let block = null;
  return lines.map(function (line, i) {
    let color = block, text = line, style = "";
    const m = TAG.exec(line);
    if (m) {
      const tag = m[2].toLowerCase();
      const reset = RESET.indexOf(tag) >= 0;
      const c = reset ? null : (tag[0] === "#" ? tag : TAG_COLORS[tag]);
      if (reset || c) {
        if (m[3].trim() === "") { block = c; color = null; style = ' style="opacity:.6"'; }  // (@green) ... (@end) block
        else { color = c; text = line.slice(0, m.index) + m[1] + m[3].replace(/^ /, "") + line.slice(m.index + m[0].length); }
      }
    }
    if (color) style = ` style="color:${color}"`;
    return `<li class="ln${i + 1}" contenteditable="true"${style}><b>${i + 1}</b>${text}</li>`;
  });
}

The colors are darker shades to suit the stock interface’s light background. Add or change any you like in TAG_COLORS. The color check runs after the text is made safe to display, and hex codes are validated, so tags can’t inject anything into the page.

To get it onto your controller, rebuild the firmware package with the firmware’s own build instructions (make pkg; see docs/development.md) and install it with Upgrade from file. If you also want an on/off switch, my version is in src/react-ui/src/gcodeColor.js and GCode.jsx on the features-1.26.0 branch of my repo. It’s GPL like the rest of the firmware, so feel free to borrow from it.

Let me know how it works with your post processor.

Mike

I am excited to give this a go soon. i am super impressed with you version updates. As an original woodworker purchaser which was upgraded to a journeyman, I hink you have made more meaningful improvements than the last few updates from 1f. I am glad someone is willing and able to keep this controller on an improvement path. thank you!

I will let you know what my experience is