Accurate temperature control of your 3D printer extruder

[Tim] is working on building a 3D printer and using it as an excuse to learn as much as he can. The first big issue he tackled was accurate temperature control, so he made an interesting write-up on how to characterize the thermal properties of an QU-BD extruder’s hot end and use that information to create a control algorithm for the heater.

The article starts with a basic thermal model and its corresponding formula. [Tim] then runs several tests where he measures the heater and extruder tip temperatures while switching on and off the heater. This allows him to figure out the several model parameters required to design his control algorithm. Finally, he tweaked his formula in order to predict the short term future so he can know when he should activate the heating element. As a result, his temperature is now accurately controlled in the 200°c +/-1°c window that he was shooting for.

Comments

  1. gajio says:

    1. learn to PID
    2. tune it
    3. problem solved

  2. Tom Hargrave says:

    This is a very good project & write-up.

  3. zumax wollo says:

    Ugh. It’s one of those sites which come up blank if you haven’t Javascript enabled.

    Here’s a sane URL for those of us sensible enough:

    And yes, it’s definitely worth a read. Pity that those gems get buried in the “Web 2.0 Experiance”

  4. Trav says:

    Without reading the article, Does he take into account the effects the filament will play in the temprature curve?

  5. Fallen says:

    Yeah should probably throw the thermal mass of the filament into his model.

  6. tekkieneet says:

    If your thermal mass is big enough, the change in temperature due to
    filament can be ignored in the thermal model. An alternative to actual
    modeling is to implement a PID controller.

    My overly simplified summary: (You can google the math).
    P: (Proportional) Amount of error
    I: (Integral) Accumulated error – used to “zero” the errors and small drifts
    D: (Derivative) slope of previous change – “predict future”
    used to reduce overshoots/oscillations

    Take the weighted sum of these to control your device and you got a
    PID controller. Play with the weight values to “tune” the control loop.

    Aren’t they already using PID for temperature control?
    (I am not “into” 3D printing articles.)

    • Regulus says:

      [Tim] is not using one of the existing & available firmware packages, he is implementing it himself, and in this project write up describes writing the logic in assembly for the PIC16F1937.

      • Trui says:

        So ? You don’t need an existing firmware package to implement a PID controller. They are pretty simple, less work than the model based solution, and more robust. And the PIC16F1937 is big enough to hold the code (and if not, simply replace the PIC)

        • hpux735 says:

          The point of saying it’s not an existing firmware package is a response to tekkineet’s comment. The RepRap (and I’m assuming closed-source) firmwares do use PID. The article author is starting from scratch, and apparently doesn’t know what PID is.

          • ChemistryDude says:

            Most firmwares for RepRap machines is open source. The whole idea of RepRap is open source. Even the electronics are open source.

    • Cypher says:

      I’ve written my own firmware and I just used PI control. The derivative term in this case doesnt help that much because of how relatively slow the heaters thermal response time is. My controller is also just roughly tuned by experimenting with the gain values, but it is pretty easily able to keep it within 1-2C of the target temperature which is good enough for most 3D printing.

      The nice thing with PI(D) control is that the integral term is adaptive, meaning that I can switch on/off my cooling fan which drastically changes the the parameters of the system but this is just automatically corrected for by integral gain.

      The only thing that bugs me a bit with my current PI control is that when I extrude a lot of filament (such as on long infills), the temperature can drop slightly because the rapid extrusion (like the cooling) changes the thermal properties of the system and takes a bit of time to correct. It would be neat to add a term to the control that adds a gain multiplied by the current rate of extrusion.

  7. gannon says:

    I haven’t read into the article too much, but I wonder how accurate his cooling curve is compared to Newton’s cooling equations.

  8. Andy says:

    The author says he is using a mechanical relay to control the heater. This means he can’t use a PID loop to control the plant.

    Even if he could implement a PID controller he would still have to tune it. In that case, it still makes sense to develop a model of the system behavior. Computers can tune a PID controller much faster than manually tuning, especially given that his system has a step response of over 10 minutes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,671 other followers