Convert Figma logo to code with AI

prusa3d logoPrusa-Firmware

Firmware for Original Prusa i3 3D printer by PrusaResearch

2,048
1,067
2,048
52

Top Related Projects

16,596

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

10,029

Klipper is a 3d-printer firmware

BIGTREETECH SKR-mini-E3 motherboard is a ultra-quiet, low-power, high-quality 3D printing machine control board. It is launched by the 3D printing team of Shenzhen BIGTREE technology co., LTD. This board is specially tailored for Ender 3 printer, perfectly replacing the original Ender3 printer motherboard.

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70

Modular, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++

Quick Overview

Prusa-Firmware is the official firmware for Prusa 3D printers, including the popular MK3S+ and Mini+ models. It's an open-source project that provides advanced features and optimizations specifically tailored for Prusa printers, ensuring high-quality prints and reliable operation.

Pros

  • Regularly updated with new features and bug fixes
  • Optimized for Prusa hardware, providing excellent print quality
  • Extensive community support and documentation
  • Advanced features like mesh bed leveling and filament sensor support

Cons

  • Limited compatibility with non-Prusa printers
  • Steep learning curve for customization and advanced features
  • Requires specific hardware configurations for optimal performance
  • Some users report occasional stability issues with certain features

Getting Started

  1. Download the latest firmware release from the GitHub repository.
  2. Connect your Prusa printer to your computer via USB.
  3. Use the Prusa Slicer or Prusa Updater tool to flash the firmware:
    • In Prusa Slicer: Configuration > Flash printer firmware
    • With Prusa Updater: Select your printer model and follow the on-screen instructions
  4. After flashing, perform a factory reset on your printer:
    • Navigate to Settings > Factory Reset on the printer's LCD screen
  5. Calibrate your printer following Prusa's official guide.

Note: Always ensure you're using the correct firmware version for your specific Prusa printer model to avoid compatibility issues.

Competitor Comparisons

16,596

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

Pros of Marlin

  • Wider compatibility with various 3D printer models and hardware configurations
  • Larger community support and more frequent updates
  • More customizable and feature-rich, with support for advanced features like mesh bed leveling

Cons of Marlin

  • Requires more configuration and setup for specific printers
  • May have a steeper learning curve for beginners
  • Potentially less optimized for specific Prusa hardware

Code Comparison

Marlin (configuration.h):

#define BAUDRATE 250000
#define MOTHERBOARD BOARD_RAMPS_14_EFB
#define X_DRIVER_TYPE  A4988
#define Y_DRIVER_TYPE  A4988
#define Z_DRIVER_TYPE  A4988

Prusa-Firmware (Configuration_prusa.h):

#define BAUDRATE 115200
#define MOTHERBOARD BOARD_EINSY_1_0a
#define X_DRIVER_TYPE  TMC2130
#define Y_DRIVER_TYPE  TMC2130
#define Z_DRIVER_TYPE  TMC2130

The code comparison shows differences in default baudrate, motherboard configuration, and stepper driver types, reflecting Prusa-Firmware's optimization for specific Prusa hardware.

10,029

Klipper is a 3d-printer firmware

Pros of Klipper

  • Higher print speeds and improved print quality due to advanced motion planning
  • Greater flexibility in hardware support, allowing use with various control boards
  • Active community development and frequent updates

Cons of Klipper

  • More complex setup and configuration process
  • Requires a separate single-board computer (e.g., Raspberry Pi) to run

Code Comparison

Klipper (Python):

def _calc_trapezoid(print_time, accel_t, cruise_t, decel_t, start_v, cruise_v, end_v):
    if decel_t:
        cruise_v = 2.0*start_v + accel_t*accel - end_v
        cruise_t = (cruise_v - start_v) / accel
    elif accel_t:
        cruise_v = start_v + accel_t*accel

Prusa-Firmware (C++):

void calculate_trapezoid_for_block(block_t* block, float entry_factor, float exit_factor) {
  unsigned long initial_rate = ceil(block->nominal_rate * entry_factor);
  unsigned long final_rate = ceil(block->nominal_rate * exit_factor);
  block->accelerate_until = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, block->acceleration_st));
}

The code snippets show different approaches to motion planning calculations, with Klipper using Python for higher-level abstractions and Prusa-Firmware using C++ for direct hardware control.

BIGTREETECH SKR-mini-E3 motherboard is a ultra-quiet, low-power, high-quality 3D printing machine control board. It is launched by the 3D printing team of Shenzhen BIGTREE technology co., LTD. This board is specially tailored for Ender 3 printer, perfectly replacing the original Ender3 printer motherboard.

Pros of BIGTREETECH-SKR-mini-E3

  • More versatile and compatible with various 3D printer models
  • Offers advanced features like silent stepper drivers and 32-bit processing
  • Active community support and frequent updates

Cons of BIGTREETECH-SKR-mini-E3

  • Less polished and refined compared to Prusa-Firmware
  • May require more technical knowledge to set up and configure
  • Potentially less stable due to broader compatibility

Code Comparison

BIGTREETECH-SKR-mini-E3:

#define X_DRIVER_TYPE  TMC2209
#define Y_DRIVER_TYPE  TMC2209
#define Z_DRIVER_TYPE  TMC2209
#define E0_DRIVER_TYPE TMC2209

Prusa-Firmware:

#define DEFAULT_AXIS_STEPS_PER_UNIT   {100,100,3200/8,140}
#define DEFAULT_MAX_FEEDRATE          {200, 200, 12, 120}
#define DEFAULT_MAX_ACCELERATION      {1000,1000,200,5000}

The BIGTREETECH-SKR-mini-E3 code snippet shows the configuration for TMC2209 stepper drivers, which offer silent operation and advanced features. The Prusa-Firmware code defines default settings for axis steps, feedrate, and acceleration, showcasing its focus on optimized performance for specific Prusa printer models.

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70

Pros of BIGTREETECH-TouchScreenFirmware

  • Supports a wide range of touchscreen displays and control boards
  • More customizable user interface with themes and layouts
  • Active community development and frequent updates

Cons of BIGTREETECH-TouchScreenFirmware

  • Less stable and mature compared to Prusa-Firmware
  • May require more configuration and setup for optimal performance
  • Limited to specific hardware configurations

Code Comparison

BIGTREETECH-TouchScreenFirmware:

void menuPrint(void)
{
  MENU_ITEM(ICON_BACKGROUND, BTT_BACKGROUND, NULL);
  MENU_ITEM(ICON_RESUME, BTT_RESUME, resumePrinting);
  MENU_ITEM(ICON_PAUSE, BTT_PAUSE, pausePrinting);
  MENU_ITEM(ICON_STOP, BTT_STOP, stopPrinting);
}

Prusa-Firmware:

void lcd_print_menu()
{
  MENU_BEGIN();
  MENU_ITEM_BACK_P(_T(MSG_MAIN));
  MENU_ITEM_FUNCTION_P(_i("Pause print"), lcd_pause_print);
  MENU_ITEM_FUNCTION_P(_T(MSG_STOP_PRINT), lcd_sdcard_stop);
  MENU_END();
}

The BIGTREETECH-TouchScreenFirmware uses a more icon-based approach for its menu system, while Prusa-Firmware relies on text-based menu items. This reflects the touchscreen-centric design of BIGTREETECH's firmware compared to Prusa's more traditional LCD interface.

Modular, opensource, high performance G-code interpreter and CNC controller written in Object-Oriented C++

Pros of Smoothieware

  • More versatile and supports a wider range of 3D printer hardware
  • Highly configurable through a single configuration file
  • Active community-driven development with frequent updates

Cons of Smoothieware

  • Less user-friendly for beginners compared to Prusa-Firmware
  • May require more manual configuration and tuning
  • Not specifically optimized for Prusa printers

Code Comparison

Smoothieware configuration example:

temperature_control.hotend.enable            true
temperature_control.hotend.thermistor_pin    0.23
temperature_control.hotend.heater_pin        2.7
temperature_control.hotend.thermistor        EPCOS100K
temperature_control.hotend.set_m_code        104

Prusa-Firmware configuration example:

#define TEMP_SENSOR_0 5
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_BED 1
#define HEATER_0_PIN MOSFET_1_PIN
#define HEATER_BED_PIN MOSFET_3_PIN

Both firmware options offer robust temperature control for 3D printers, but Smoothieware's configuration is more centralized in a single file, while Prusa-Firmware uses multiple C++ header files for configuration. Smoothieware's approach may be more accessible for quick adjustments, while Prusa-Firmware's method allows for more granular control within the codebase.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Prusa Firmware MK3

This repository contains the source code and the development versions of the firmware running on the Original Prusa i3 MK3S/MK3/MK2.5S/MK2.5 line of printers.

The latest official builds can be downloaded from Prusa Drivers. Pre-built development releases are also available here.

The firmware for the Original Prusa i3 printers is proudly based on Marlin 1.0.x by Scott Lahteine (@thinkyhead) et al. and is distributed under the terms of the GNU GPL 3 license.

This repository contains development material only!

Build

Linux

There are two ways to build Prusa-Firmware on Linux: using CMake (recommended for developers) or with PF-build which is more user-friendly for casual users.

CMake

Quick-start

The workflow should be pretty straightforward for anyone with development experience. After installing git and a recent version of python 3 all you have to do is:

# clone the repository
git clone https://github.com/prusa3d/Prusa-Firmware
cd Prusa-Firmware

# automatically setup dependencies
./utils/bootstrap.py

# configure and build
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/AvrGcc.cmake
ninja

Detailed CMake guide

Building with cmake requires:

  • cmake >= 3.22.5
  • ninja >= 1.12.1 (optional, but recommended)

Python >= 3.8 is also required with the following modules:

  • pyelftools (package python3-pyelftools)
  • polib (package python3-polib)
  • regex (package python3-regex)

Additionally gettext is required for translators.

Assuming a recent Debian/Ubuntu distribution, install the dependencies globally with:

sudo apt-get install cmake ninja python3-pyelftools python3-polib python3-regex gettext

When using a recent Fedora(non-atomic)/RHEL distribution, install the dependencies globally with:

sudo dnf install cmake ninja-build python3-pyelftools python3-polib python3-regex gettext

When using a Fedora Atomic/UBlue distribution use rpm-ostree install --allow-inactive instead of sudo dnf install

Prusa-Firmware depends on a pinned version of avr-gcc and the external prusa3dboards package. These can be setup using ./utils/bootstrap.py:

# automatically setup dependencies
./utils/bootstrap.py

which will download and unpack them inside the .dependencies directory. ./utils/bootstrap.py will also install cmake, ninja and the required python packages if missing, although installing those through the system's package manager is usually preferred.

You can then proceed by creating a build directory, configure for AVR and build:

# configure
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/AvrGcc.cmake

# build
ninja

By default all variants are built. There are several ways to restrict the build for development. During configuration you can set:

  • cmake -DFW_VARIANTS=variant: comma-separated list of variants to build. This is the file name as present in Firmware/variants without the final .h.
  • cmake -DMAIN_LANGUAGES=languages: comma-separated list of ISO language codes to include as main translations.
  • cmake -DCOMMUNITY_LANGUAGES=languages: comma-separated list of ISO language codes to include as community translations.

When building the following targets are available:

  • ninja ALL_MULTILANG: build all multi-language targets (default)
  • ninja ALL_ENGLISH: build all single-language targets
  • ninja ALL_FIRMWARE: build all single and multi-language targets
  • ninja VARIANT_ENGLISH: build the single-language version of VARIANT
  • ninja VARIANT_MULTILANG: build the multi-language version of VARIANT
  • ninja check_lang: build and check all language translations
  • ninja check_lang_ISO: build and check all variants with language ISO
  • ninja check_lang_VARIANT: build and check all languages for VARIANT
  • ninja check_lang_VARIANT_ISO: build and check language ISO for VARIANT

Automated tests

Automated tests are built with cmake by configuring for the current host:

# clone the repository
git clone https://github.com/prusa3d/Prusa-Firmware
cd Prusa-Firmware

# automatically setup dependencies
./utils/bootstrap.py

# configure and build
mkdir build
cd build
cmake .. -G Ninja
ninja

# run the tests
ctest

PF-build

PF-build is recommended for users without development experience. Download or clone the repository, then run PF-build and simply follow the instructions:

cd Prusa-Firmware
./PF-build.sh

PF-build currently assumes a Debian/Ubuntu (or derivative) distribution.

Windows

Visual Studio Code (VSCode)

Prerequisites

First time setup

Start by cloning the Prusa-Firmware repository

git clone https://github.com/prusa3d/Prusa-Firmware

Open the Prusa-Firmware folder in VScode.

Open a new terminal in VScode (Terminal→New Terminal) and run

python .\utils\bootstrap.py

This will download all dependencies required to build the firmware. You should see a .dependencies folder in the Prusa-Firmware folder.

Reload VScode. If all works correctly you should see the VScode automatically configuring the CMake project for you. If this doesn't happen you likely need to set the CMake kit; This can be done in two ways:

  1. Type Ctrl+Shift+P and search for CMake: Select a Kit. Select avr-gcc. If none appear, Scan for kits first.
  2. If 1) does not work for some reason, as a last resort you can edit the CMake Tools settings. Search for "Additional Kits" and add .vscode/cmake-kits.json to the list.

After updating the kit, you may need to reload VScode.

Building

To start building a firmware, click the CMake Tools plugin icon on the far left side. You will get a very large list of targets to build. Find the firmware you'd like to build (like MK3S_ENGLISH) and select the small icon which shows "Build" when hovered over.

The built .hex file can then be found in folder Prusa-Firmware/build

Arduino IDE (deprecated)

Using Arduino IDE is still possible, but no longer supported. Prusa-Firmware requires a complex multi-step build process that cannot be done automatically with just the IDE. For a long time we provided instructions to use Arduino in combination with shell scripts, however starting with 3.13 the build system has been completely switched to cmake.

Building with Arduino IDE results in a limited firmware:

  • Arduino IDE can only build a single, english-only variant at a time that you manually have to select
  • The build will not be reproducible (meaning you will likely get a different binary every time you build the same sources)
  • You need to download, patch and select the correct board definitions by hand

For these reasons, you should think twice before reporting issues for a firmware built with Arduino. If you find a bug in the firmware, building and testing using CMake should be your first thought. Issues regarding Arduino builds are answered by the community and are not officially supported.

Environment preparation

Install "Arduino Software IDE" from the official website https://www.arduino.cc -> Software -> Downloads. Version 1.8.19 or higher is required.

Setup Arduino to install and use the Prusa board definitions:

  • Open Arduino and navigate to File -> Preferences -> Settings
  • To the text field "Additional Boards Manager URLs" add https://raw.githubusercontent.com/prusa3d/Arduino_Boards/master/IDE_Board_Manager/package_prusa3d_index.json
  • Open Board manager (Tools -> Board -> Board manager)
  • Install "Prusa Research AVR Boards by Prusa Research"

Source code preparation

Clone or download this repository to your local drive.

In the subdirectory Firmware/variants/ select the configuration file (.h) corresponding to your printer model and manually copy it to Firmware/Configuration_prusa.h

Run "Arduino IDE", then

  • Open the file Firmware/Firmware.ino
  • Select the target board with Tools -> Board -> "PrusaResearch Einsy RAMBo"
  • Open Firmware/config.h and change LANG_MODE to 0.

Compilation and upload

  • Run the compilation: Sketch -> Verify/Compile
  • Upload the result code into the connected printer: Sketch -> Upload