What is FabBSD?
FabBSD driving a PCB drilling machine

FabBSD is an open-source, 4.4BSD-based UNIX-like operating system designed specifically for machine controllers. It is used in applications such as:

  • Machine tools: CNC milling machines, lathes, routers, lasers
  • Automation: Manipulators, power supplies, relays, valves, heaters
  • Instrumentation: Optical encoders, thickness gauges, sensors

The typical FabBSD-based control system uses a fanless, headless System-on-a-Chip board (network appliance boards with general-purpose I/O ports such as the Soekris are ideal), fitted with application-specific controls such as manual-pulse generator handwheels, and interfaced over the network. FabBSD runs on a number of different hardware architecture.

FabBSD's kernel regulates system interrupts and handles process scheduling, context switching and FPU management differently from a general-purpose kernel, such that real-time tasks can be performed without sacrificing the convenience of a fully functional Unix system. Canonical machine control functions are built into FabBSD's native executable format. This provides user-mode applications (e.g., ngc, move, boltpattern, gerbdrill) with an efficient interface to the hardware. The ngc interpreter can execute standard machining programs in RS-274/NGC v3 format.

A common task of FabBSD systems is the coordinated motion of machine axes, whether driven by steppers, servo-motors or cylinders (with or without software-based closed-loop control). FabBSD uses a kernel-mode trajectory planner to generate stable motion control signals (using blended S-curve velocity profiles) at high frequencies with minimal hardware requirements. For example, a 133MHz 486-class processor with 32MB of RAM is sufficient for driving 3 Geckodrives at their maximum working frequency. The kernel configuration file for such a system might look like:

servo0 at gpio? offset 0 mask 0x3               # X axis
servo1 at gpio? offset 2 mask 0x3               # Y axis
servo2 at gpio? offset 4 mask 0x3               # Z axis
estop0 at gpio? offset 0 mask 0x1 flags 0x0000  # Emergency stop
encoder0 at gpio? offset 0 mask 0x3             # Quadrature encoder
mpg0 at gpio1 offset 18 mask 0x1f               # Manual Pulse Generator
spotwelder0 at gpio? offset 5 mask 0xf          # AC spot welder

FabBSD's kernel and base are forked from OpenBSD. Its machine control drivers (/sys/dev/cnc/), userland libraries (libcnc) and applications could be easily ported back to OpenBSD, NetBSD or FreeBSD with minimal patching to other parts of the kernel. The base distribution includes OpenSSH, Sudo, Binutils, GCC and GDB. The installation process is straightforward (via CD-ROM, FTP, floppies or tapes).

As of 2018, FabBSD is undergoing active development again and contributors are welcome to provide feedback or patches. The latest FabBSD source is available via Subversion at https://dev.csoft.net/fabbsd/trunk. The repository is also mirrored on GitHub under /JulNadeauCA/FabBSD (base system) and /JulNadeauCA/FabBSD-Ports (ports and packages).

FabBSD must perform various tasks in real-time (e.g., with clock and other system interrupts disabled). Such tasks include motion control (e.g., for machine tools), or the decoding of feedback signals. Therefore, FabBSD-based systems usually provide hardware-based emergency stop buttons, switches, joysticks, knobs, LCD displays, etc. These devices are typically connected via RS-232 interfaces or general-purpose I/O pins.

The most critical tasks handled by FabBSD is the generation of motion control signals (i.e., the step and direction signals of typical servo and stepper controllers), and the interpretation of quadrature signals generated by rotary encoders. FabBSD performs these tasks entirely in kernel mode, with all system interrupts disabled. This implies that FabBSD will usually be run on a machine dedicated to this purpose.

Here is a video of FabBSD on a 486 CPU running a 640 oz-in stepper up to 860rpm using a 10-microstep Gecko controller.

Related projects: Edacious, Agar-SG, cadtools.

06/13/2018 The FabBSD repository is now mirrored on GitHub at: https://github.com/JulNadeauCA/FabBSD (base system) and https://github.com/JulNadeauCA/FabBSD-Ports (ports and packages).
05/15/2010 The "jog" function is now implemented in user-land. For the jog(1) command to work after updating, users of manual pulse generator handwheels on existing installations should use:
cd /dev && sh MAKEDEV mpg0
03/26/2009 This project is now known as "FabBSD". A new Subversion repository has been created. While the former "machctl" code was in the form of patches and kernel extensions specific to CAM (and limited to interpreted programs), FabBSD becomes a stand-alone operating system dedicated to CAM and general automation applications.

Donate via PayPal
Csoft.net ElectronTubeStore