Keeping Snap And Crackle Under Control With Prunt Printer Firmware

A Prunt 3D printer control board is shown mounted in a 3D printer, just behind a power supply, in the center of the image.

For quite some time now, Marlin has been the firmware of choice for any kind of custom 3D printer, with only Klipper offering some serious competition in the open-source world. [Liam Powell] aims to introduce some more variety with the development of Prunt, a 3D printer control board and firmware stack.

Smooth motion control is Prunt’s biggest advantage: Klipper and Marlin use trapezoidal (three-phase) motion profiles, which aim for acceleration changes with physically impossible rapidity, leading to vibrations and ringing on prints. By contrast, Prunt uses a more physically realistic 31-phase motion profile. This lets the user independently adjust velocity, acceleration, jerk, snap, and crackle (the increasingly higher-order derivatives of position with respect to time) to reduce vibration and create smoother prints. To avoid sharp accelerations, Prunt can also turn corners into 15-degree Bézier curves.

The focus on smooth motion isn’t just a software feature; the Prunt control board uses hardware timers to control step generation, rather than the CPU. This avoids the timing issues which Klipper sometimes faces, and avoids slowing other parts of the program down. The board also seems to have a particular focus on avoiding electrical damage. It can detect short circuits in the heaters, thermistors, fans, and endstops, and can cut power and give the user a warning when one occurs. If the board somehow experiences a serious electrical fault, the USB port is isolated to prevent damage to the host computer. The firmware’s source is available on GitHub.

If you’re more interested in well-established programs, we’ve given a quick introduction to Klipper in the past. We’ve also seen people develop their own firmware for the Bambu Lab X1.

27 thoughts on “Keeping Snap And Crackle Under Control With Prunt Printer Firmware

    1. It’s always about trade-offs. Marlin is absolutely god-awful when you want to make some changes in configuration. Klipper? Edit a config file, restart the process and you are done. After using both I can’t use Marlin anymore, it’s just too cumbersome for me.

    2. Last I checked, every Marlin board on the market has uses SD card. Klipper doesn’t inherently require the use of an SD card. On the host side, you can use a Pi Compute Module with baked in EMMC memory if you want, or a full-blown PC. Linux isn’t a hard requirement, either. Klipper is just a Python app. I don’t know of any control boards that have eMMC memory or similar, but there’s no reason that klipper has to have an SD card on the client device side, either. Also, “just works” means recompiling and reflashing with every configuration change. No thanks!-

  1. Their site does not dive deep into the juicy technical stuff, which is exactly what hardcore, living-in-the-bleeding-edge users would like to read, but for a first presentation of the firmware it does fine.
    The use of a GUI is also a really nice addition, that eases the way for beginners and also doesn’t hinder the more experienced users (RRF also does that).
    It looks like the firmware is married with the hardware, much like reprapfirmware was with Duet3D’s boards at the beginning, but I wouldn’t be surprised if 3rd-party boards are created if this firmware becomes popular enough.

    That’s a really interesting addition to the 3d printing landscape, I’ll keep an eye on it to see where it goes.

    1. For our trajectory planning we have a non-mathematical explanation in the sections on the features page titled “G4 Motion Profiles” and “Advanced Corner Blending”.

      If anyone has questions on a specific technical detail then I’m happy to answer them here or on our Discord server. We plan to write a series of posts on more of higher level concepts involved eventually but that’s not done yet.

  2. i was frustrated by the write up of the “motion model” here…strikes me as a bad gloss. even in so few words, i think better words could have been chosen. but the write up on the prunt site is pretty good! https://prunt3d.com/docs/features/#g-motion-profiles

    i’m not crazy about klipper and i figure marlin’s enduring popularity is just a perfect example of ‘worse is better’. i, for one, am not interested in rewriting something that happens to work :)

    (but yes i can see the ringing in my prints)

    1. Can I ask what it is you dislike about klipper? I’ve generally had great results with it. The UI options less so, but the core firmware I’ve been fairly happy with.

      1. it’s just a philosophical complaint…i don’t begrudge it.

        i rememer when soft modems started to take over the world in the late 90s, there was a post from Linus Torvalds that called them all garbage. i don’t feel that they’re garbage. but when a good enough serial protocol already exists, i vaguely prefer to implement the entire protocol inside of the device instead of having half of it implemented on the “host CPU”. i want to send G-code to the printer. shrug

    1. If by “CNC” you mean “CNC milling” and by “slicer” you mean “CAM”. Then rest assured we have free opensource CAM software for CNC milling. Namely bCNC, FreeCAD, kiri:moto and couple more… (laserweb, camotics, blendercam, pycam). Also there is huge possibility of software improvements to all of those, because commercial software has fancier features and opensource still has to catch up.

      Also there is this thing https://github.com/Harvie/cnc-simulator

    2. as others have said it is called cam software and there are plenty around and have been for a long time. CNC mill/lathe operators despise the term “slicer” for the most part. Also even though it gets a very bad wrap the free version of Fusion 360 does a pretty good converting solid’s into gcode for mills and lathes.

      here is a quick and i’m sure not 100% complete list of cam software and post processors out there

  3. Nice work on the Bezier curve cornering. Klipper and then Marlin went down the input shaping route instead (I implemented IS in Marlin). One correction to the material at https://prunt3d.com/docs/features/#g-motion-profiles: S-Curve (at least what Marlin calls S-Curve) is linear in pop. Which makes it smoother than prunt if I have understood correctly. However it’s the abrupt direction changes on cornering which are the real problem in Marlin.

    1. I’ll have to look in to this and update the docs. At a glance it doesn’t look like Marlin gives the user control over the bounds of each derivative, it just fits a predetermined curve to have the same derivative as the original velocity curve, which is much easier. I haven’t tested Marlin’s S-Curve acceleration on any of the printers I test Prunt on so I don’t have any insights on how well it performs in comparison.

      For reference Marlin’s 16 line algorithm is here: https://github.com/MarlinFirmware/Marlin/blob/62bb61b3d9b0e109cf0b132aeea9ce2613d18874/Marlin/src/module/stepper.cpp#L843-L858

      1400 lines of just part of our algorithm are here: https://github.com/Prunt3D/prunt/blob/master/src/prunt-motion_planner.adb

  4. “To avoid sharp accelerations, Prunt can also turn corners into 15-degree Bézier curves.”

    I’m not quite sure what that means, since I’m pretty sure a corner has to be 90° /eventually/ or it’s not a corner.

    1. A Bézier curve is a polynomial – that’s why you hear about quadratic or cubic Bézier curves. The degree of a polynomial is the highest exponent used, so a 15-degree Bézier curve would have (up to) 15 terms.

Leave a Reply to sd cards are for camerasCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.