HOW TO: PID Auto-Tuning for Ender 3 and Other 3D Printers

Swings in temperature for your 3D printer’s hot end, such as the Ender 3, is just plain no good for quality print results. Steady, controlled heat is what you are looking for and getting it right can be great for your print results. PID auto-tuning is a way to control the temperature by using an algorithm to determine the values that the printer uses to heat and maintain temperatures. Below you will find the instructions to set your PID values. This method is going to change the values that are stored in your printer, and used every time it heats. This method is great for setting the PID values if you use very similar filament, and cooling most every time you print. If you use a lot of varying filament, or use cooling on some and not on others, you will want to modify your slicer printer settings to set the PID values for each configuration. Lets take a look:

  • First off, use a terminal command processor to send commands to your printer – such as OctoPrint, Repetier Host, or Simplify 3D.
  • Start your printer in a cooled state, with the material you are going to use (such as PLA) primed in the hotend – either from a previous print or heat the printer and push through a few inches of filament and let it cool back down
  • Start the cooling fans if you intend to use them as part of the results you want from the PID test. Send the command M303 E0 S205; to the printer for a temperature of 205C – change the S value to whatever target temperature you are looking to get stable heating for like this:
M303 E0 S205;
  • The printer will take about 5 minutes or so and run through the auto-tune test.
  • When it is complete, Marlin will spit out the test values for P, I and D looking something like this near the end of the output:
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h
Recv: #define DEFAULT_Kp 27.44
Recv: #define DEFAULT_Ki 3.60
Recv: #define DEFAULT_Kd 52.26
Recv: ok
  • Now tell your printer that you have new defaults, sending in new values for the PID values that you received from the test. In my example I send it the values like this
M301 H1 P27.44 I3.60 D52.26;
  • And it returns a success looking like this:
Recv: echo: p:27.44 i:3.60 d:52.26
Recv: ok
  • Next up, you will want to save your settings to the firmware, or the next time you cycle the power, you will lose the settings, so send the save settings command like this:
M500;

There you go, you should be all set to go with stable PID settings that make your printer produce better prints . A couple of quick things to note:

  1. I have seen some varying settings and re-running the whole thing a few times will give you interesting variations in the values returned. The first time I ran this on a printer, the resulting values produced oscillating temperatures (around +-4 degrees C) which is a little too much. You are looking for tight temperature ranges – I was happy with the settings above that roughly stayed very solid in the 204-206 degree C range. Re-running the test a few times you may find a set of values that really tighten it up for you as well.
  2. Remember, if you are swapping in another brand of filament, a different type of filament (like going from PLA to PETG), or using fans vs. no part fans, you will want to either re-run this test and store them in firmware to use until you change them again, or send the M301 command in your printer profile with each of the values for P, I, and D for the configuration each time you go to print. This method takes a little more work, but ensures that the settings are correct for the config you are intending to use.

That’s it for today, if you have a comment or tip leave it below – we would love to hear from you. Happy printing!

TOP 10: Best Ender 3 3D Printer Upgrades

Have a Ender 3 Printer, or getting one soon and want to know which upgrades you might want to take a look at? Well here is my list of the best of the bunch, in the order that, in hindsight, make the best upgrades. Some are better at making your prints turn out, some are for ease of use, some are just plain fun – let’s take a look:

  1. Upgraded extruder arm mechanism – this is the first thing you should do if you plan to print more than just now and then. Even then, you will want to do this in the long run. The plastic arm included in the stock Ender will wear and does not have the strength that an aluminum upgrade will give you. Upgraded extruder arm mechanism – this is the first thing you should do if you plan to print more than just now and then. Even then, you will want to do this in the long run. The plastic arm included in the stock Ender will wear and does not have the strength that an aluminum upgrade will give you.
  2. Glass Bed – A glass bed is just the best surface you can get (followed closely by #3 below). Get a glass bed and a can of Aqua Net Extra Super Hold hairspray and never look back. Perfectly smooth bottoms, no more dents in your stock build surface from improper leveling, and a great all around performer when it comes to adhesion.
  3. Removable Magnetic Build Surfaces – OK, the truth is, some days I think this is better than glass. I have 2 Enders, so I don’t have to choose. The removable magnetic build surface gives you a super easy way to remove prints, rarely needs cleaning because it sticks so darn well, and you will never drive a spatula into your arm trying to get a stuck on print to come loose.
  4. PetFang Cooling – This is a 3D print you can do yourself, for a nice improvement on finished products. The instructions take a bit to figure out which ones you need to print (and it depends on if you do #5 below) but it’s so worth the time.
    https://www.thingiverse.com/thing:2759439
  5. Dual Fans on the PetFang – While you are on #4, go ahead and add 2 fans to the Fang. If you get into PETG or just want great results on overhangs and no stringing, boost the airflow and rejoice.
  6. OctoPrint – Get a Raspberry Pi, an SD card, and install OctoPrint. Best thing you can do. Drag and drop files, monitor your progress on a PC, install some plugins to make everything more better, add a web cam and record that 3 day print. Just so much value here. Get this one done soon.
  7. Upgraded Rollers – Print these rollers out, and grab a few bearings for other fun projects while you are at it. This upgrade reduces drag and lets your filament be free to roll on! This Thingiverse link has a great wall mounted version, which I added to my space where 16 rollers now live to feed the printers. Awesome look, and they work really well. Print them at 50% infill or up for a nice solid roller and mount.
    https://www.thingiverse.com/thing:3020026
  8. Filament Guide – Get a guide to keep that filament away from your Z axis screw and the rollers on the motor. I like this one (
    https://www.thingiverse.com/thing:3275225 ) because you can stick it in when you forget (every time for me) and it stays nice and secure – also bonus is screwless install. Print an extra for the day when you break it off wresting with your printer or something nearby.  
  9. Firmware Upgrade – Grab an Arduino and upgrade your firmware to the latest Marlin code for advanced features and the most important runaway thermal protection. If you leave your printer alone a lot to do it’s thing, move this one up on the list.
  10. Main Board Gen L Upgrade – Pretty thrifty way to upgrade your printer to take cool upgrades (see steppers and auto bed leveling). The Gen L won’t really make your prints any better, but you can add more to the firmware and upgrade the steppers.
  11. Upgraded Steppers – You can do this with add-on chips for the stock Ender board, but I have heard that you don’t get much with that route. Adding the Gen-L above and upgrading your steppers will give you super quiet motors (your existing ones become very quiet). I used the TMC2130’s – on the X and Y only. You can replace all 4, but I went with 2x 2130’s and 2x A4988’s (direct replacements of the stock ones that come on the original). This gives you a pretty quiet machine, and leaves the Z axis a little noisier – which you only notice on homing, and makes for a great audio cue when a print starts to take a look and make sure those crucial first layers go down right.
  12. BL or 3D Touch – Here is one that you can print a mount from the Fang kit above and add auto leveling to your machine, and after doing so you may wonder why this is so far down on the list. I added this to both of the Enders, and really it is one of the best upgrades you can do but learning about leveling first really is handy – manually. You will learn a bunch of stuff about your printer and 3D printing in general that will help you troubleshoot a pesky print, and pays off if you don’t have that knowledge already. After you have that figured out, do this one.
  13. Color Touch Screen – I did this one on one of the 2 Enders I have and I love it. It is a nice upgrade that does absolutely nothing other than makes you smile. It’s a fun weekend project, has some wow factor, and if you do OctoPrint above, you will rarely if ever touch it. But it’s cool.

There it is, the complete getting started list. Leave comments below if you have a must have upgrade, or want to share your experience. Check out the Teaching Tech channel on YouTube for many guides on how to install this stuff, his content is superb. Happy Printing!

3D Printing Layer Shift Troubleshooting Tips

Nothing is less fun than finding that your long print on you 3D printer has failed due to shifting. Here are a few tips to look into if you find that you are having a shifting issue with your printer.

  • Check your belts. If you have belts on your specific printer, make sure they are really tight. Look at your print and determine which axis is shifting. Focus on that belt. A great tip here is to mark your belt and motor gear when you start a print with a sharpie, and see if you are getting slipping. Tighten. Repeat.
  • Check for missed steps. Same as above, mark your belts if you have them. This will show you what might need some tightening.
  • Check the voltage on your stepper motors. Find out what the voltage should be for your stepper motor drivers, use a multi-meter and make sure you have enough voltage heading into them (my Ender 3 for example has upgraded TMC2130 steppers, the correct voltage for these is about .76V)
  • Try different infill patterns. Some patterns jerk the printer around so much that it just can’t keep up, and you will get a shift. Start with a simple infill pattern in your slicer and see if it helps
  • Use a different slicer. I have used Cura, and found that some prints just don’t behave with whatever infill I use, due to the sliced output file. I keep Slic3r on my workstation and load it up there, usually with “different” results – sometimes a complete success, other times with clues to what might be tweaked elsewhere
  • Move the object in your slicer. Sometimes people have success with just moving the object off center in the slicer before exporting it to the printer. Try this if it’s small, otherwise make sure you go through the list above first – or risk printing some plastic trash
  • Slow down the print. My printer defaults to 60mm/s print speed. Some of the objects that I print just don’t like that speed, so slow it down! Try 40mm/s or something and see if your results vary.
  • Replace your stepper. Find the offending stepper driver, and replace it. If you don’t have another on hand, swap the offending axis driver with one that seems to work in your machine and print a test to find out if ordering a replacement might be in the cards for you

Do you have tips that would help with figuring out shift issues with your 3D prints? Let us know in the comments below. Happy printing!

HOW TO: Multiple 3D Printers Using OctoPrint 2019 – Raspberry Pi and Ender 3 Step by Step

OctoPrint is a great project for setting up 3D printers to control from a web based interface. Even when only using a single printer, the advantage to connecting a Raspberry Pi to your 3D printers is amazing:

  • Great UI to see your printer and it’s status
  • Allows you to connect to web cams to see progress, locally and remotely
  • A bunch of great plugins to control and monitor your printers – do fun stuff like post updates to a slack channel to keep track of prints and so much more
  • Drag files to print to the web interface instead of messing around with SD cards
  • Easily view print status, cancel prints, organize your upcoming prints
  • Check and modify temperatures, flow rate, feed rate, motors and fans
  • Issue GCode directly to the printer
  • Update the firmware of your 3D printer, directly from the OctoPrint interface
  • Learn a little Linux, and do that Raspberry Pi build you have been thinking about

Here is a step by step guide to get you up and running on OctoPrint using multiple 3D printers:

  1. Install OctoPrint
    1. Download the latest image found HERE
    2. Burn the image to an SD card using ETCHER
    3. Install PUTTY or use another SSH client (your OS may have one)
    4. Insert the SD in your Raspberry Pi, and power it up!
    5. Connect to the Pi using Putty – you may need to figure out it’s IP using your router admin interface
      1. PROTIP: Optional – configure your router to give the MAC ID or your Pi a static address and/or name to make it easier to connect in the future
    6. Follow the instruction above with one printer connected and verify that OctoPrint can control your first printer
      1. PROTIP: Get comfortable with OctoPrint first, use it for a print or two if this is your first time, as some things will make more sense later
      2. PROTIP: Install some plugins before copying below, in some cases this will make things easier down the road
      3. PROTIP: When you are done and happy with a single printer, create a backup in OctoPrint, and download it to your PC just in case
  2. Out of the box, OctoPrint can connect to multiple printers, but not to control them all at once – so we need to login to the Pi and get started copying some files and change some things to get new instances of OctoPrint running for each of your printers. The following details show 2 printers being connected, it certainly works for 3 or more – up to the performance limitations of your Pi – mileage may vary, but 3 works without a hitch for me
    1. Copy the OctoPrint directory
      1. cp -R /home/pi/.octoprint /home/pi/.octoprint2
    2. Copy the config script
      1. sudo cp /etc/default/octoprint /etc/default/octoprint2
    3. Modify the config script
      1. sudo nano /etc/default/octoprint2
        1. PROTIP: Ctrl-X to save when you are done in nano, Y to confirm, enter to confirm file name
    4. And change the port and arguments  to look like the 2 lines below (leave the “DAEMON=” line as it is, it is used by each of the new Octo-instances)
      1. PORT=5001
        DAEMON_ARGS="--port=5001 --config home/pi/.octoprint2/config.yaml --basedir /home/pi/.octoprint2"
    5. Copy the init Script
      1. sudo cp /etc/init.d/octoprint /etc/init.d/octoprint2
    6. Modify the init Script
      1. sudo nano /etc/init.d/octoprint2
    7. Change everything here to be octoprint2 (EXCEPT the DAEMON= line again) and save it like so:
      1. #!/bin/sh### BEGIN INIT INFO
        # Provides: octoprint2
        # Required-Start: $local_fs networking
        # Required-Stop:
        # Should-Start:
        # Should-Stop:
        # Default-Start: 2 3 4 5
        # Default-Stop: 0 1 6
        # Short-Description: OctoPrint2 daemon
        # Description: Starts the OctoPrint2 daemon with the user specified in
        # /etc/default/octoprint2.
        ### END INIT INFO# Author: Sami OlmariPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
        DESC="OctoPrint2 Daemon"
        NAME="OctoPrint2"
        DAEMON=/usr/bin/octoprint
        PIDFILE=/var/run/$NAME.pid
        PKGNAME=octoprint2
        ...
    8. Reload the init script
      1. sudo systemctl daemon-reload
    9. Let’s make it start every time automatically after booting
      1. sudo update-rc.d octoprint2 defaults
    10. Without a reboot you can just start it now
      1. sudo /etc/init.d/octoprint2 start
    11. And check the status like so:
      1. systemctl status octoprint2.service

That’s it! You should be able to log into your OctoPrint service on your Pi now via a remote browser from your PC. If the original (use the ip you determined before) was using the default port, you connected like this
http://192.168.1.150
And now your new printer should be ready to go on port 5001 like this:
http://192.168.1.150:5001

Remember, the IP address above is an example, you need to figure out what IP your Pi received on your network.

OK, bonus time now, this is optional, but makes things handy in the OctoPrint UI to figure out which printer is connected to which USB port. When the Pi boots, for example, USB0 may be assigned to printer 1, but next time to Printer 2 – so lets create some settings that make it easier to figure that out in OctoPrint.

  1. Use Putty, or whatever, to get connected again if you are not already there to the Pi
  2. Plug your printers in and fire them up
  3. Check out your udev info to figure out some of the differences between the connected devices to make some changes later. Here, for example, we can take a look at USB0:
    1. udevadm info -q all -n /dev/ttyUSB0 --attribute-walk
  4. Then, for example, take a look at USB1:
    1. udevadm info -q all -n /dev/ttyUSB1 --attribute-walk
  5. These commands will spill a bunch of info that you will need to differentiate each connection, my file below is just an example, but usually you can use the “idVendor” and “idProduct” and “devPath” attributes as the differences.
  6. Look at the first section with these attributes for EACH of these commands and make note of the attribute values for the 2 commands. If at least ONE of the 3 is different from the other 3, you are good to go and use the example below. If they are the same, you need to look through the attributes to fine ones that differ and include those
  7. OPTIONALLY – if you are familiar with “diff” you can pipe the commands to files, then use diff to show the differences and use it’s output to figure out what attributes you will use in our rules file below like this:
    1. udevadm info -a -n /dev/ttyUSB0 > devInfoUSB0
      udevadm info -a -n /dev/ttyUSB1 > devInfoUSB1
      diff -u devInfoUSB0 devInfoUSB1
  8. OK. Almost there. Lets create some rules! Now we just need to create symlinks to those attributes to some names that we can see in OctoPrint to make it easy to figure out what the heck we are connecting to. On the Pi, lets do this:
      1. cd /etc/udev/rules.d/
        sudo nano 99-usb.rules
  9. And paste/enter something like this in the file, ctrl-x to save again like above (remember, these are MY settings – use your attributes and values that we figured out above – there should be 3 lines in the file, the 3rd is an EXAMPLE for a 3rd printer, so if you are just doing 2, there should be something close to the first 2 lines): I have 3 printers here, I called them ttyEnder3_1, ttyEnder3_2, and ttyMonoMini. Name yours whatever makes sense to you for your printer types.

    1. SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", ATTRS{devpath}=="1.1.3", SYMLINK+="ttyENDER3_2"
      SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{devpath}=="1.3", SYMLINK+="ttyENDER3_1"
      SUBSYSTEM=="tty", ATTRS{idVendor}=="2974", ATTRS{idProduct}=="0503", ATTRS{devpath}=="1.1.2", SYMLINK+="ttyMonoMini"
  10. BONUS: Set your timezone if you haven’t already on the Pi before we reboot and take a look:
      1. cp /usr/share/zoneinfo/America/Chicago /etc/localtime
      2. OR like this:
      3. ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime
  11. Either way you set that, if you are unsure of the zone, type up to the point you need to change it, and hit tab a couple of times for your options… So typing this:
    1. cp /usr/share/zoneinfo/
      will display this
      Africa/ CET Etc/ Greenwich Japan Navajo PST8PDT US/
      America/ Chile/ Europe/ Hongkong Kwajalein NZ right/ UTC
      Antarctica/ CST6CDT Factory HST leap-seconds.list NZ-CHAT ROC WET
      Arctic/ Cuba GB Iceland Libya Pacific/ ROK W-SU
      Asia/ EET GB-Eire Indian/ localtime Poland Singapore zone1970.tab
      Atlantic/ Egypt GMT Iran MET Portugal SystemV/ zone.tab
      Australia/ Eire GMT0 iso3166.tab Mexico/ posix/ Turkey Zulu
      Brazil/ EST GMT-0 Israel MST posixrules UCT
      Canada/ EST5EDT GMT+0 Jamaica MST7MDT PRC Universal
      And the same goes for the rest of the command to get yours right.
  12. Lets reboot, and browse to your URL’s again above, and configure each one to find the new device names in the serial settings.
    1. Click the Wrench icon in OctoPrint
    2. You should be in Printer->Serial Connection->General
    3. In the Additional Serial Ports box, lets add some rules to pick up the new device links, mine looks like this: 

Hit save, refresh your browser, and you should have new, way better names in your connection drop-down like this to differentiate your connections:

And that is it! I hope you find this helpful, let me know in the comments below if there are missing steps, or if you have better/other ways of doing some of the things here. Happy Printing!