It’s a start of a new year! I’d like to take a moment to go over some development targets that I have for Klipper in 2024. These are things that I’d like to see merged into the main Klipper repository this year.
In brief:
-
Support for MCU flashing from the graphical frontends.
-
A Klipper “plugin” system for external modules.
-
Rework the documentation and installation scripts to recommend Moonraker and Klipper specific frontends.
-
Support for fan and output_pin “templates”.
-
Support for probing and homing with load-cells.
-
Rework of Klipper’s “homing” and “probing” code.
In addition to the above, there are a few high-level topics that I’m planning to closely watch in 2024:
-
Support for multi-material filament switching systems.
-
Filament flow rate detection hardware and systems for improved flow-rate calibration.
-
Heater modeling improvements.
All of the above are “aspirational”, and they only reflect my goals. Other contributors will have their own goals.
Some additional context:
Support for MCU flashing from the graphical frontends
I’ve discussed this a few times in the past (eg, Experiment with automated mcu flashing ). I think it would be useful if most users could install and upgrade Klipper without having to use “ssh”. That is, I believe it should be possible to extend Klipper and the various web frontends to handle basic MCU management. This would include detecting available micro-controllers (eg, by scanning in /dev/serial/
), compile the micro-controller code (eg, by automating make menuconfig
), and flash that code.
This isn’t an easy task due to the many different boards that are available. Klipper supports hundreds of boards and there are seemingly thousands of different ways to flash those boards! I believe the benefits are likely to outweigh the costs however.
A Klipper “plugin” system for external modules
Klipper is highly programmable, both via its “Jinja2 macro” system and via changes to its core Python code. That flexibility has enabled a vast array of impressive extensions. I think it would be useful to further encourage developers to enhance their 3d printers and make those enhancements rapidly available to others. An official Klipper “plugin” system could help spur these enhancements.
Ideally there would be two parts to a Klipper “plugin” system - support in Klipper itself for plugins, and a global repository that developers could list their plugins (and users could search to find the plugins they are interested in).
It is important to me that Klipper have a robust error reporting system that can rapidly point users and developers to any code causing problems. As such, I do not envision any plugins running within the main Klipper process - instead I envision plugins would run in a separate process. This should make it much easier to identify who to contact in case of a problem. It also means that a plugin will not be able to do everything that Klipper itself could possibly do. However, I still think there are many powerful enhancements that could be done via a plugin.
Rework the documentation and installation scripts to recommend Moonraker and a Klipper specific frontend
The official Klipper documentation still recommends installation using OctoPrint. However, most installations today use one of the Klipper specific frontends, and the documentation should be updated to reflect this. In particular, if we add new features like MCU flashing to the frontends, there will be even more incentive to recommend those frontends.
In addition to the documentation, I think we need to review the installation scripts within Klipper along with the example config files. We really want users to be able to use an example config file from the Klipper repository “as is”, and we really want the internal regression testing code to test example config files just as a user would use them. I think this means reviewing common Klipper modules like “virtual_sdcard”, “pause_resume”, “save_variables”, and similar. For example, we may want to have these modules auto-load in Klipper so that they are available for all users “out of the box”.
Support for fan and output_pin “templates”
Klipper has a lot of support for setting fans, pins, servos, and similar. However, much of this functionality is controlled via G-Code commands which can be delayed when there are other commands running. Klipper has an “led template” system that allows LEDs to be configured using a “formula” so that they update separately from g-code commands. I think it would be useful to extend this to fans, output_pin, and similar modules. It should allow more robust control of peripherals and make Klipper more flexible.
Support for probing and homing with load-cells
There has been a lot of interesting work with load-cells and there are several readily available 3d printers shipping with them today. It would be good to see this support merged into the main Klipper repository.
Rework of Klipper’s “homing” and “probing” code
At the core of Klipper’s homing and probing code is the G28
and PROBE
commands. I think we may have reached the limits on these commands and that it may be time to “take a step back” and rethink how “probing movements” should be implemented in Klipper.
The current system has some known limitations (in no particular order):
-
Sensorless homing requires elaborate macros and it is difficult to detect errors in these macros. Sensorless homing would benefit notably from extra error checking.
-
Probing often requires elaborate macros to “dock” and “undock” the probe. It is difficult to implement error checking in these macros and error checking would have high value.
-
The manual_stepper module supports a limited form of “homing”, but using it can result in excessive delays.
-
It can be useful to tie filament loading to a filament sensor, but Klipper does not support this type of “extruder homing” today.
-
It can be useful to have multiple simultaneous probes on a toolhead, but Klipper supports only one active PROBE module.
-
The endstop_phases system can provide notable benefits to repeatable Z positioning, but it doesn’t currently support many printers (in particular, printers that home Z via probe hardware). The core functionality should be usable on nearly all printers if it is made more flexible.
-
Printers really want “homing moves” to occur at a constant stepper velocity, however klipper currently homes at a constant “toolhead velocity”. This is problematic for some types of printer kinematics (such as scara, polar, and rotary delta).
-
And others…
Much of these limitations are due to Klipper’s internal code abstraction for homing and probing movements. As such, I suspect Klipper could benefit from some internal work in this area.
For what it is worth, I do not envision a future “all encompassing homing configuration” system in Klipper. The current G28
command effectively means “do what ever it takes so that Klipper knows where the axes are relative to the bed/frame”. Unfortunately, this doesn’t scale - understanding the configuration system needed to describe “whatever it takes” is far more complicated than explicitly stating the “steps to take”.
Alas, I don’t know what a future homing/probing system should look like. I do think it is something worthwhile to investigate and enhance in Klipper.
Support for multi-material filament switching systems
There are several popular filament switching systems available today (eg, ERCF, MMU2S, Pallette). Support is not a core goal of mine for 2024, but it is something I hope to “keep an eye on”.
Filament flow rate detection hardware, and systems for improved flow-rate calibration
Extruder “flow rate” calibration is an important, but painful process today. Calibrating it is important to get parts with accurate dimensions and good surface quality.
Currently, one can calibrate “flow rate” via “rotation_distance”, via slicer “extrusion multiplier” configuration, via M221
“extrude factor override” commands, or via SET_EXTRUDER_ROTATION_DISTANCE
commands. All these settings do effectively the same thing, but they are commonly described using different wording or with different calibration mechanisms. It is madness!
We’ve also seen some interesting developments on the hardware side - hardware tools and processes for automatically detecting an appropriate flow rate. (This may involve cameras, lidar, photo sensors, filament width sensors, or similar.)
I don’t have any “answers” in this area, but it is something I hope to “keep an eye on”.
Heater modeling improvements
Klipper has a very basic PID system for extruders and beds. This system works surprisingly well. However, we do seem to be hitting some limits, in particular with high-power extruder heaters and with very high extrusion rates.
There has been some interesting work in “feed forward” control systems recently (eg, “Marlin’s MPC” system). Something to “keep an eye on”.
Again, these are “aspirational goals” for 2024. Without doubt, there will be other features merged that are not mentioned here.
Happy New Year!!
-Kevin