RepRapFirmware

On this page 8

RepRapFirmware (often shortened to RRF) is an open-source, 32-bit motion control firmware that runs directly on a printer controller board and turns G-code into coordinated stepper motion, heater control and sensor handling. Within 3D printer hardware, it is the native firmware of the Duet family of controller boards and an alternative to Marlin and Klipper for machines ranging from small Cartesian printers to large delta, CoreXY and tool-changing systems.

Its defining traits are configuration through plain G-code files instead of recompilation, a built-in web interface, and a scripting layer that lets builders write conditional macros. These features make RRF popular with builders of custom and industrial-style machines who want deep control without maintaining a source code fork.

How RepRapFirmware controls a printer

RepRapFirmware works as a real-time controller running on the mainboard itself: it parses G-code, plans motion, generates step pulses and runs closed-loop heater control on one 32-bit ARM microcontroller. Since version 3, it uses a real-time operating system (FreeRTOS) to separate time-critical tasks such as step generation from communication and file handling.

The motion system uses a look-ahead planner that joins consecutive moves, limits speed changes at corners with jerk (instantaneous speed change) settings, and calculates acceleration for each axis according to the active kinematics model. Step timing is computed on the board, so the firmware does not depend on a host computer for motion, which is the key architectural difference from Klipper.

At startup the firmware reads config.g from the SD card and executes it line by line. This file defines axes, steps per millimeter, motor currents, heaters, thermistors, fans, endstops and probes. Separate system macros such as homeall.g, bed.g, pause.g and tfree0.g run automatically when the matching event occurs.

The table below lists the main building blocks of a typical RRF installation and what each one does.

ComponentLocationRole
Firmware binaryController flash memoryMotion planning, step generation, heater control
config.gSD card, sys folderDefines machine hardware at every boot
System macrosSD card, sys folderHoming, bed leveling, pause, tool changes
Duet Web ControlServed by the board or a single-board computerBrowser interface for control and file upload
Object modelFirmware memoryLive machine state readable by macros and clients
Core components of a RepRapFirmware setup

Supported boards and operating modes

RepRapFirmware is developed primarily for Duet3D controller boards, and official releases target those boards first. Community ports extend it to selected LPC1768 and STM32 boards, although feature coverage and support on those ports depend on volunteer maintainers rather than the main project.

Duet 3 boards can run in standalone mode, where the board serves the web interface itself, or in SBC mode, where an attached Raspberry Pi runs the Duet Software Framework and handles files and networking while the board still performs all real-time motion. Duet 3 also uses a CAN-FD bus to connect expansion boards and toolboards, which lets a machine distribute motors, heaters and sensors across several boards.

The following table compares the main hardware generations that run RRF.

PlatformMicrocontroller classTypical use
Duet 2 WiFi and EthernetSAM4E, 32-bit ARM Cortex-M4Hobby and prosumer printers, legacy machines
Duet 3 Mini 5+SAME5x, ARM Cortex-M4FCompact single-board printers
Duet 3 Mainboard 6HCSAME70, ARM Cortex-M7Large printers, tool changers, CAN expansion
Duet 3 Mainboard 6XDSAME70, ARM Cortex-M7External drivers and closed-loop servo motors
Community portsLPC1768 or STM32Low-cost boards with partial feature support
Common hardware platforms for RepRapFirmware

Key features of RRF

The feature set of RepRapFirmware targets precise motion and flexible automation. Kinematics are selected at run time with the M669 command, so a single binary supports Cartesian, CoreXY, CoreXZ, delta, SCARA, polar and Hangprinter geometries without recompiling.

  • Conditional G-code and meta commands such as if, while, var and global allow macros that react to sensor values and machine state.
  • Input shaping with M593 reduces ringing by filtering commanded motion at the resonant frequency of the frame.
  • Pressure advance with M572 compensates for melt pressure lag in the extruder.
  • Mesh bed compensation with G29 and M557 corrects an uneven bed using a bed probe.
  • Heater fault detection and model-based tuning with M303 provide thermal runaway protection.
  • Stall detection with Trinamic stepper drivers enables sensorless homing on supported boards.

These capabilities overlap with other firmware, but RRF exposes them through documented G-code commands that can be changed live from the console. A builder can test a new motor current or acceleration limit immediately and then copy the working line into config.g.

RepRapFirmware compared with Marlin and Klipper

RepRapFirmware, Marlin and Klipper solve the same problem with different architectures. Marlin is compiled with machine settings baked into the binary, Klipper offloads planning to a host computer, and RRF keeps all real-time work on the board while reading its configuration from files.

The comparison below summarizes the practical differences that matter when choosing a firmware for a build.

AspectRepRapFirmwareMarlinKlipper
ConfigurationG-code files on SD cardCompile-time headersText file on host
Motion planningOn the controller boardOn the controller boardOn a host computer
Host requirementNone, optional SBCNoneRequired, often a Raspberry Pi
Web interfaceBuilt in on networked boardsRequires OctoPrint or similarMainsail or Fluidd on host
Hardware rangeMainly Duet boardsVery wide, including 8-bitVery wide, many MCUs
ScriptingConditional G-code, object modelLimited macrosJinja2 templates in macros
Firmware architecture comparison

The main trade-off is hardware choice versus integration. RRF offers a tightly integrated and well-documented experience, but it effectively ties a builder to Duet-class hardware, which costs more than generic boards supported by Marlin or Klipper.

Configuring and updating RepRapFirmware

A new RRF machine is usually configured with the online configuration tool published for Duet boards, which generates a starting config.g and homing macros from a form. The builder then refines values such as steps per millimeter, motor current and thermistor coefficients by editing the files in Duet Web Control.

Firmware updates are performed by uploading the release archive through the web interface, which flashes the main board and, on Duet 3, any connected CAN expansion boards. Because major versions change command syntax, builders should read the upgrade notes before moving between major releases, for example from RRF 2 to RRF 3.

The decision table below shows when RRF is a strong choice and when another firmware may suit a project better.

SituationRecommendationReason
Custom large-format or tool-changing printerChoose RRF on Duet 3CAN expansion and conditional macros scale well
Budget printer with a stock 8-bit boardUse MarlinRRF does not run on 8-bit controllers
Existing cheap 32-bit board, maximum speedConsider KlipperHost-based planning on inexpensive hardware
Machine without a host computerRRF or MarlinBoth run fully on the board
Closed-loop servo or external driversRRF on a 6XD boardDesigned for step and direction outputs
When to choose RepRapFirmware

Limitations and common mistakes

RepRapFirmware is robust, but most problems come from configuration errors rather than firmware bugs. The firmware executes config.g exactly as written, so a wrong drive mapping or missing axis definition produces confusing behavior later in the file.

  • Copying configuration from another major version often fails silently because commands such as M569 and M950 changed meaning in RRF 3.
  • Wrong thermistor parameters cause inaccurate temperatures and can trigger heater faults or poor extrusion.
  • Skipping heater tuning leaves temperature oscillation that shows up as surface banding.
  • Using community ports for production work can mean missing features and slower fixes.
  • Ignoring the console output after boot hides warnings that point directly to the faulty line.

A practical habit is to run M98 P"config.g" after every edit and read every reported error before printing. This single step catches most mistakes before they affect hardware.

The idea in brief

RepRapFirmware is the software brain inside the printer’s control board. It reads printing instructions, moves the motors in step, keeps the nozzle and bed at the right temperature, and watches the sensors.

Its special strength is that settings live in simple text files, much like a recipe card that can be edited at any time. There is no need to rebuild the software to change a value. Owners also get a web page for controlling the printer from any browser on the network.

A practical scenario

A small engineering workshop builds a CoreXY printer with a 400 by 400 mm bed and four swappable tool heads for multi-material parts. The team chooses a Duet 3 Mainboard 6HC running RepRapFirmware, plus one CAN-connected toolboard on each tool head, so every head carries its own heater, fan and extruder motor with only a power and data cable to the frame.

Tool changes are written as conditional macros that check whether a tool is docked before moving, and input shaping set at about 45 Hz removes visible ringing at 8,000 mm/s² acceleration. When a heater cartridge later fails, the firmware detects the fault, stops the print safely and reports the affected tool. The outcome is a reliable machine that the team adjusts through the browser without recompiling anything.