Pid tune your HyperCube hot end & heat bed with Duet

Increase the quality, appearance, and consistency of your 3D prints by PID tuning your hot and heat bed. Improper heating can cause print artifacts, layer adhesion issues, banding, and generally poor performing prints.

The Duet controllers provide an amazingly simple process that we’ll walk you through to help you tune the controller and have consistent print temps.

Step 1 – Set up config.g

Ensure your congig.g has this command at the bottom:


m501 tells the Duet to load up config-override.g. Config-override.g is the file created by the automatic PID tuning commands when you choose to save the output.

Step 2 – Pid tune hot end

Good to know: Common slicers such as Prusa, Slic3r and Cura all use H0 for heat bed and H1 for hot-end out of the box so we’ll stick with that pattern. I find it’s best to make sure your firmware matches this pattern to save a lot of headaches.

If you print primarily PLA with a part cooling fan, ensure that you have turned the part cooling fan on.

For this example PID tuning I’ll set the fan to 100%, set my PID tune to 210c and let the DuetWifi do its magic.

m106 S255 ; set tool fan to full speed
m303 h1 s210 ; PID tune the hotend at 210c
m106 s0 ; disable tool fan

Your printer will warm up the hotend and display some messages as it cycles through and then notify it is complete. Once complete, be sure to send an m500 to save the config. Your saved config will be saved in the config-override.g which is why it’s important to have your m501 in config.g to load it on startup.


If you print primarily in PETG or ABS, you should set your m303 1h to 240 or so. You may only want your hot end fan on at 50%

Example for PETG/ABS

m106 S128 ; set fan to 50% speed (or disable if you don't use part cooling fan with petg with s0)
m303 h1 s240 ; PID tune the hotend at 240c

It’s not 100% necessary to PID tune 100% to the material you use, but if you have a primary material it helps. Especially true if you print PETG with a glossy surface where surface imperfections from slight temperature differences in your hotend or heat bed leave obvious surface artifacts & imperfections.

Note: If you get an error about PID tuning failed because a heater is inactive, you can click on the heater in the web interface and turn it active and re-run the macro.

Step 3 – Pid tune heat bed.

Along with your hot end, you should PID tune your heat bed so it holds consistent & reliable temperatures. Inconsistent heating can cause many filaments to have horizontal banding issues.

Run the following gcode which tells the duet to run a PID tune on h0 up to 60c.  I turn my part cooling fan on so I pid tune with how the printer works most of the time.

m106 S255 ; set tool fan to full speed
M303 H0 S60 m500 ; saves to config-override
m106 S0 ; set tool fan to off

Again, if you print primarily PETG or ABS, then increase your heat bed to those temps.

PID tune heat bed for ABS set s100 to be PID tune to 100c.

m106 S255 ; set tool fan to full speed
M303 H0 S100 m500 ; saves to config-override
m106 S0 ; set tool fan to off

Pid Tune head bed for PETG – A common bed temp for printing PETG is 80c.  Since I only print at about 80% fan speed with PETG, I set my m106 to about 80%. Some people print with no part cooling fan so simply remove the m106 if that is how you typically print PETG.

m106 S204 ; set tool fan to 80% speed
M303 H0 S80 m500 ; saves to config-override
m106 S0 ; set tool fan to off

Note: You should re-tune your hot end after any major updates, upgrades as well as seasonal temperature variations. This includes winter/spring/fall temp changes, new nozzles, new hot end socks, new fans, power supply swaps or changes that can impact any of the temperature probing and measuring of your printer.

PID Tune Macros

I discovered during testing that m303 is an asynchronous process so a macro can’t complete the entire PID tuning in current versions of firmware. I am testing an RRF 3.01 macro with the new gcode conditional support and will re-publish the macros after further testing for those upgrading to 3.01 RC/Beta.

While the gcode conditional logic support works, it does disconnect you from the web interface because it doesn’t pass asynchronously to the background so it may not be a worthy endeavor just yet or it may be of better value to those with PanelDue displays where you can still interact with the printer while the macro runs.

Wrap Up

Hopefully, these simple steps help you improve your print quality and ensure great print consistency and reliability! The Duet controller does an amazing job at making our printing experience second to none, so be sure to take advantage of it’s built-in PID tuning to achieve the quality and performance you desire (and paid for!).

Leave a Comment