Friday, August 29, 2025
HomeABS - FilamentAutotune PID what it is and how to use it

Autotune PID what it is and how to use it

Autotune PID is a feature that is included in Marlin and most branches of it to help determine the best settings for the hot-end temp control.

So what does it do? Well simply put it heats up the hot-end and cools it several times to determine the optimum setting for the heating element part.

PID tuning refers to a proportional-integral-derivative control algorithm used in most “reprap” style machines  for hot ends and heated beds.

PID needs to have a P, I and D value defined to control the nozzle temperature. If the temperature ramps up quickly and slows as it approaches the target temperature, or if it varies by a few degrees either side of the target temperature, then the values are wrong, and you need to run Autotune

So let’s look at that part of it in marlin here is a sample of the code from one of my machines

// PID settings:

// Comment the following line to disable PID and enable bang-bang.

#define PIDTEMP

#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current 2014-8-27

#define PID_MAX 255 //255 2014-8-27

#ifdef PIDTEMP

//#define PID_DEBUG // Sends debug data to the serial port.

//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX

#define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature

                                 // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.

#define PID_INTEGRAL_DRIVE_MAX 255 //limit for the integral term

#define K1 0.95 //smoothing factor within the PID

#define PID_dT ((OVERSAMPLENR * 8.0)/(F_CPU / 64.0 / 256.0)) //sampling period of the temperature routine

// If you are using a pee-configured hot-end then you can use one of the value sets by uncommenting it

// Ultimaker

   #define DEFAULT_Kp 22.2

   #define DEFAULT_Ki 1.08

   #define DEFAULT_Kd 114

/*

// Prusa r2d2 I3 2014-8-27

   #define DEFAULT_Kp 17.52

   #define DEFAULT_Ki 0.62

   #define DEFAULT_Kd 123.43

*/

This section is where you update your PID settings after you have run the Autotune

Here’s the code to run Autotune – M303 E0 S200 C8 Let me break it down so you can see what each part of this isM303 the machine CODE TO START AUTOTUNE E0 the hot-end to use S200 how hot we want it to get in this case 200 degrees. C8 this is how many cycles we want to run the Autotune you need to run it at a minimum of at least 8 times I do it 10 times but that’s me How do we use this?Well now that we know what it does let’s use it in a program you can use one of the FREE and popular programs either Promtierface or Repeater-host both of them work just fine first connect your printer to the software then in the space where you can enter g-codes type M303 E0 S200 C8 press enter and just wait it does take a few minutes you should see some results scroll on the screen like this

pid2
heat your hot-end before you run the PID Autotune

Info:PID Autotune start

00:10:51.020 : bias: 39 d: 39 min: 149.51 max: 153.52

00:11:10.066 : bias: 39 d: 39 min: 149.12 max: 150.85

00:11:27.180 : bias: 37 d: 37 min: 149.41 max: 150.80

00:11:27.181 : Ku: 34.12 Tu: 17.11

00:11:27.181 : Classic PID

00:11:27.182 : Kp: 20.47

00:11:27.182 : Ki: 2.39

00:11:27.183 : Kd: 43.79

00:11:44.316 : bias: 37 d: 37 min: 149.41 max: 150.80

00:11:44.317 : Ku: 34.12 Tu: 17.14

00:11:44.317 : Classic PID

00:11:44.318 : Kp: 20.47

00:11:44.318 : Ki: 2.39

00:11:44.319 : Kd: 43.85

00:12:01.616 : bias: 37 d: 37 min: 149.41 max: 150.80

00:12:01.618 : Ku: 34.12 Tu: 17.30

00:12:01.618 : Classic PID

00:12:01.619 : Kp: 20.47

00:12:01.619 : Ki: 2.37

00:12:01.620 : Kd: 44.27

00:12:01.624 : Info:PID Autotune finished ! Place the Kp, Ki and Kd constants in the Configuration.h or EEPROM

(This is an abbreviated list you should have a total 8 test and then it will give you the classic PID this is what you need)

At the end you will get three values, the classic PID Kp, Ki, Kd.

pid1
PID Autotune testing temp

You will need to open and update the default values in Configuration.h in the Marlin Software.

#define DEFAULT_Kp 20.47

#define DEFAULT_Ki 2.37

#define DEFAULT_Kd 44.27

Then re-upload the firmware and you all set your hot-end is tuned for that machine.

If you can write to EEPROM on then you can do this

M500 P20.47 I2.37 D44.27 and that will write it to the EEPROM

Or temporarily you can use but not save it to the machine and you will have to do it every time you power up the  3d printer

M301 P20.47 I2.37 D44.27

Well there it is how to use Autotune for your hot-end this will help stabilize you temp on the hot-end and help make nicer prints.

Here is the wiki page for Autotune http://reprap.org/wiki/PID_Tuning

Previous article
Next article
RELATED ARTICLES

2 COMMENTS

Most Popular

Recent Comments

mperkins37 on 3D Printed Rockets
desitheblonde on New Low-Cost LSAM 3D Printer
Mad3DHatter on Flex3Drive Review
Salvatore_Lacorte on Guide to Successful ABS Printing
Jordi Lopez on 3D Printer Maintenance
Bill Nonnenmacher on 3D Printed Gears Easy!
Andy Marriott on Flex3Drive Review
Denny Hannaford on Creality Ender 3 Announced
Tom Baxter on 3D Printer Maintenance
Daniel Faegnell on How does 3D Printing work?
Tom Baxter on 3D Printer Maintenance
Tom Baxter on 3D Printer Maintenance
Henry Jolly on 3D Printer Maintenance
mperkins37 on 3D Printer Maintenance
Brian Martin on 3D Printer Maintenance
Melanie F. on DIY etching
Melissa Englebright on 3D Printer Maintenance
Kelly Freeman on 3D Printer Maintenance
Jeremy Fister on 3D Printer Maintenance
Ronan on DIY etching
mperkins37 on 3D Printer Maintenance
mperkins37 on 3D Printer Maintenance
mperkins37 on 3D Printer Maintenance
Leesa R McClure on 3D Printer Maintenance
Charles Goldman on 3D Printer Maintenance
Tom Baxter on 3D Printer Maintenance
mperkins37 on 3D Printer Maintenance
Carol Oddy on DIY etching
Tom Baxter on 3D Printer Maintenance
Michael Perkins on 3D Printer Maintenance
Michael Perkins on 3D Printer Maintenance
Michael Perkins on 3D Printer Maintenance
Richard Bynum on 3D Printer Maintenance
Richard Bynum on Slicers: Which one to use?
Brian Martin on Flexion Retrofit Kit Review
Carol Oddy on DIY etching
Richard Bynum on Flexion Retrofit Kit Review
Michael Perkins on Flexion Retrofit Kit Review
Richard Bynum on 3d printer Extruders
Michael Perkins on DIY etching
Richard Bynum on Rigid.ink Review
Justin K Jones on Wanhao D7 Review
Brian Martin on Creality Ender 3 Announced
Michael Perkins on Creality Ender 3 Announced
Richard Bynum on Autodesk to .STL
Chris Kockler on Creality Ender 3 Announced
Michael Perkins on MG Chemicals wood filament
Ronald Shropshire on MG Chemicals wood filament
Michael Perkins on MG Chemicals wood filament
Richard Bynum on 3D printed CNC Mill
Richard Bynum on 10 Fun Things to 3D Print
Justin Flugum on Creality Ender 3 Announced
Richard Bynum on Creality Ender 3 Announced
Justin Flugum on Creality Ender 3 Announced
David Griffith Rowe on Interesting 3D Printed Drone Projects
Richard Bynum on Wanhao D7 Review
Richard Bynum on ColorFabb Filament Review
Richard Bynum on Who is 3D-PT?
Richard Bynum on BuildTak – Is it Worth it?
Richard Bynum on Who’s 3D model is it?
Sumit Trivedi on MG Chemicals wood filament
Richard Bynum on CAD Review for 3D Printers
Asgor Reidaa on DIY etching
Asgor Reidaa on Wanhao D7 Review
Richard Bynum on MG Chemicals wood filament
Richard Bynum on 3d Print a Rubber band gun
Richard Bynum on 3d Print a Rubber band gun
Justin Flugum on Wanhao D7 Review
Tom Baxter on Wanhao D7 Review
Asgor Reidaa on 3d Print a Rubber band gun
Nathan Cox on Wanhao D7 Review
Nathan Cox on DIY etching
Tom Baxter on DIY etching
Richard Bynum on DIY etching
George Fomitchev on DIY etching
Richard Bynum on Wanhao D7 Review
Richard Bynum on Magnetic PLA Filament
Justin Flugum on Selfcad – A Short Review
Justin Flugum on Top 10 3D Printer Upgrades
Stan Baldwin on Vacuum Drying PLA Pt.1
Richard Bynum on 3D Printed Robots & Figures
Richard Bynum on Marlin a beginners guide
Richard Bynum on G-Codes – Wiki
Richard Bynum on How to NOT Be a 3DHubs Noob
Richard Bynum on 3D-Printing for Scuba Diving
Richard Bynum on Vacuum Drying PLA Pt.2
Asgor Reidaa on 3D Printing Dictionary
Richard Bynum on Vacuum Drying PLA Pt.1
Richard Bynum on What 3D-Printer to buy 2016
Richard Bynum on 3D Printing Homes
Madalyn Nguyen on 3D Printing Dictionary
Daniel Waldner on Prusa i3 MK3 – New Features
Richard Bynum on TOP 5 3D PRINTED CARS
Richard Bynum on 3D Printer safety tips
Annaloa Hilmarsdottir on The Anet A8 3D-Printer DIY Kit Review
David Robert Pemberton on 3D Printed Grenade Launcher
Justin Flugum on 3D Printer safety tips
Darren Scrubb on 3D Printing in the Classroom
Tom Baxter on 3D Printable Tools
Darren Scrubb on 3D Printing Homes
Darren Scrubb on 3D Printing Jewellery
Richard Bynum on Flex3Drive Review
Stan Baldwin on 3D Printed Grenade Launcher
Richard Bynum on Magigoo Adhesive Pen
Linda Beghtel on 3D Printing Jewellery
Richard Bynum on How much to Charge?
Justin Flugum on How much to Charge?
Jon Gardner on Big 3D Printers
Tom Baxter on 3D Printing Dictionary
Richard Bynum on 3D Print Wood Working Tools.
Richard Bynum on Sienci Labs Mill One
Lori Mahan on 3D Printing Jewellery
Tom Baxter on RIP Pinshape 2013-2016
Richard Bynum on 3D Printing Dictionary
Justin Flugum on 3D Printable Tools
B Michenfelder on Sienci Labs Mill One
John Smith on 3D Printing Jewellery
Richard Bynum on 3D Printed Gears Easy!
Stephen Shimatzki on The 3D Printing Gifts Guide 2018
Richard Bynum on Helpful Holiday Safety PSA.
Santiago Archilla on Making Money With 3D Printing
Braxten Brannon on 3D Printing in the Classroom
Stuart Hawton on 3D Print Wood Working Tools.
Richard Bynum on 3D Printing Jewellery
Tom Baxter on 3D Printing Jewellery
Stuart Hawton on 3D Printing Jewellery
Stuart Hawton on 3D Printing in the Classroom
Richard Bynum on 6 Taboos of 3D Printing
Dawn Mateo De Acusta on Holiday Gifts for Your 3D Printer
Todd Whetstone on Folgertech FT-5 R2 – Review
Todd Whetstone on Folgertech FT-5 R2 – Review
Richard Bynum on 3D Printing Filament Review
Sandi McGinnis on Folgertech FT-5 R2 – Review
Andreas Gasser on Folgertech FT-5 R2 – Review
Edward Dekkers on Folgertech FT-5 R2 – Review
Andrew Venkersammy on Holiday Gifts for Your 3D Printer
Braxten Brannon on 10 Hotends for your 3D printer
Jon Acosto (3DPrintnerd.com) on Calidum HALE Heated Bed – Review
Macario on Flex3Drive Review
Tom Baxter on Beer based Filament
Tom Baxter on Rick and Morty 3D Models
Richard Bynum on Rick and Morty 3D Models
Richard Bynum on Top 10 3D Printer Upgrades
eduardo martini on Prusa i3 MK3 – New Features
Richard Bynum on Random Models on Thingiverse
Richard Bynum on Random Models on Thingiverse
Michael Champlin on Random Models on Thingiverse
Richard Bynum on Random Models on Thingiverse
Michael Champlin on How to calibrate a 3D Printer
Michael Champlin on 3D Printer safety tips
Richard Bynum on Selfcad – A Short Review
Richard Bynum on Selfcad – A Short Review
Richard Bynum on The Ultimaker 2 3D Printer
Jared Heifetz on Top 5 3D Printers Under $300
Jared Heifetz on Top 5 3D Printers Under $300
Richard Bynum on Top 5 3D Printers Under $300
Jared Heifetz on 3D Printer safety tips
Richard Bynum on 3D Printer safety tips
Jared Heifetz on Magigoo Adhesive Pen
Jon Acosto (3DPrintnerd.com) on The 13 Phases of 3D Printing
Jared Heifetz on 3D Printable Tools
Richard Bynum on 3D Printable Tools
Jared Heifetz on 3D Printable Tools
David Klein on 3D Printable Tools
Richard Bynum on 3D Printable Tools
mperkins37 on 3D Printable Tools
Jared Heifetz on 3D Printable Tools
mperkins37 on 3D Printable Tools
Dewu Han on 3D Printable Tools
mperkins37 on 3D Printable Tools
Tania Alam on 3D Printable Tools
Jon Acosto (3DPrintnerd.com) on Advertising Your 3D Printing Business
mperkins37 on Sienci Labs Mill One
mperkins37 on Flex3Drive Review
Jeffrey M. Holliman on Flex3Drive Review
tpoage@mindspring.com on The Ultimaker 2 3D Printer
tpoage@mindspring.com on Snapmaker: The All-Metal 3D Printer
tpoage@mindspring.com on The best 3d print bed material
tpoage@mindspring.com on Snapmaker: The All-Metal 3D Printer
Stan Baldwin on 3D Printed Grenade Launcher
tpoage@mindspring.com on 3D Printed Grenade Launcher
tpoage@mindspring.com on A New Era in Desktop 3D Printing
tpoage@mindspring.com on Dynamo3D One Pro Unboxing & First Print
tpoage@mindspring.com on 3D Printed Guns as Illegal 3D File?
tpoage@mindspring.com on 3D Printed Guns as Illegal 3D File?
tpoage@mindspring.com on Get more from your cyclops scanners
tpoage@mindspring.com on 5 kits to get more from your 3D Printer
mperkins37 on TOP 5 3D PRINTED CARS
tpoage@mindspring.com on Top 10 3D Printer Upgrades
tpoage@mindspring.com on Media falsely attacks 3d printing again
tpoage@mindspring.com on 3D Printing Communities on Google+
tpoage@mindspring.com on 3D Print Wood Working Tools.
mperkins37 on TOP 5 3D PRINTED CARS
tpoage@mindspring.com on 3D Printing Market Trends For 2017
mperkins37 on TOP 5 3D PRINTED CARS
tpoage@mindspring.com on 3d Printing Brushless Motors and More
tpoage@mindspring.com on TOP 5 3D PRINTED CARS
jvastine on TOP 5 3D PRINTED CARS
mperkins37 on TOP 5 3D PRINTED CARS
tpoage@mindspring.com on 3D Printer manufacturers list 2020
tpoage@mindspring.com on How Strong is PLA? Lab Experiment!
tpoage@mindspring.com on Vacuum Drying PLA Pt.2
tpoage@mindspring.com on Top 6 Unique CAD Programs (2016-2017)
tpoage@mindspring.com on Finishing & Painting A 3D Printed Alien!
tpoage@mindspring.com on 10 Popular 3D Printing Fidget Patterns
tpoage@mindspring.com on Slicers: Which one to use?
tpoage@mindspring.com on Top 10 Large Format 3D Printers
tpoage@mindspring.com on 13 Best CAD Programs for Kids
tpoage@mindspring.com on 10 Places To Get Free 3D-Printing Files
tpoage@mindspring.com on Upgrading a Prusa i3
tpoage@mindspring.com on Top 7 3D Scanners on a Low Budget
tpoage@mindspring.com on 5 Fun Prints for your new 3d printer.
tpoage@mindspring.com on The Tantillus Part 1
tpoage@mindspring.com on What is Love? 3D Print Me (NSFW)
tpoage@mindspring.com on 3D Printing for the Second Cold War Pt.1
tpoage@mindspring.com on 5 Ways to Feed your 3D Printing Habit
tpoage@mindspring.com on Helpful Holiday Safety PSA.
tpoage@mindspring.com on 3D Printing a Quadcopter: Part 1
mperkins37 on Testing TinkerCAD Beta
tpoage@mindspring.com on Will your 3D-printer kill you?
mperkins37 on Testing TinkerCAD Beta
tpoage@mindspring.com on Big 3D Printers
mperkins37 on Testing TinkerCAD Beta
tpoage@mindspring.com on Testing TinkerCAD Beta
mperkins37 on Testing TinkerCAD Beta
tpoage@mindspring.com on Nanodax Glass Wool Polypropylene Review
tpoage@mindspring.com on Kanesis Hemp Bio Plastic PLA Review
tpoage@mindspring.com on Great 3D-Printers to look for 2016!
choschiba on 3D Printing Fidgets
tpoage@mindspring.com on Folgertech Kossel build Part 1
tpoage@mindspring.com on Build Plate Supported 3D Printing
tpoage@mindspring.com on Top 6 Unique CAD Programs (2016-2017)
tpoage@mindspring.com on Let’s move our prints to the cloud!
tpoage@mindspring.com on The Guardian of Techno phobia
tpoage@mindspring.com on 3D printing your own cosmetics with Mink
tpoage@mindspring.com on 3D Printing Fidgets
tpoage@mindspring.com on Folgertech Kossel build Part 1
tpoage@mindspring.com on Build Plate Supported 3D Printing
tpoage@mindspring.com on Ultimaker 3 – A Quick Review
Nick Kalogeropoulos on Why 3D Printing Must Alter Its Course
Andrew Werby on 3D Printing Homes
Andrew Werby on 3D Printing Homes
Nick Kalogeropoulos on 3D Printing in the Army: Here’s how
mperkins37 on 3D Printing Homes
mperkins37 on 3D Printing Homes
juggernath on 3D Printing Homes
mudface2003 on Upgrading a Prusa i3
Alexis Puentes on Five amazing DIY 3d printers.
lucpet on 3D Printing Piracy
Tony Davies on 10 Fun Things to 3D Print
Italo Soares on 3D Printed Gears Easy!
Frostbite on Vacuum Drying PLA Pt.1
3AM Productions on 3D printer after care Package
3AM Productions on RIP Pinshape 2013-2016
Italo Soares on About me: Italo Soares
Lays Rodrigues on Slicers: Which one to use?
Robbie Pearson on How To Use TinkerCAD
Robbie Pearson on Edit STL Files with TinkerCAD
Tony Davies on Marlin a beginners guide
3AM Productions on 3D PRINTED SEX TOYS
Alexis Puentes on Sintron Prusa i3 Review
Daniel F on Beer based Filament
Curtis J. Pratt on Beer based Filament
bioelectrobot on Beer based Filament
admin on Makergear M2