6l17ch
Posts: 3
Joined: Sun Nov 04, 2018 11:28 am

Controlling extruder temp more exactly

Sun Nov 04, 2018 11:44 am

I'm trying to print Stoempie's Temp Tower for ABS https://www.thingiverse.com/thing:2493504 on my Qidi Tech 1 (a Makerbot clone).

I went into Simplify3D's process settings and configured the extruder to change temp at the correct layers of the print and turned off the cooling.

As I'm watching the print in progress, I do see the machine making the correct adjustments to the extruder's target temp at the proper points. The issue I'm struggling with is that the extruder itself is almost never actually at that target temp. It seems to stay 4-7 degrees below the target at all times. I've tried looking into the temperature settings in Simplify3D again in hopes of finding a setting that would allow me to direct the machine to verify the extruder temp between each layer and reheat itself as needed but haven't found anything in the documentation so far to do that.

I did stumble across the scripts tab which has a section for Layer Change Script. I'm wondering if adding "M133 T0 ; Stabilize right extruder temperature" to that section would accomplish this? Or does anyone have other suggestions for getting a little more control around the extruder temp?

SWCNT
Posts: 27
Joined: Mon Jul 16, 2018 9:51 am

Re: Controlling extruder temp more exactly

Mon Nov 05, 2018 7:22 pm

That tower goes in steps of 5C, can you elaborate more on "It seems to stay 4-7 degrees below the target at all times"? Does that mean you aren't even hitting the first temp? If it's every 5C, then being 7C below means you've got slight cooling, which is odd if you are trying to heat the nozzle up. Have you done a PID autotune for the middle of the temperature range? It might be that the PID curve is way off. Using the S3D stabilize temp would only affect the first layer, it would not pause between layers because that would cause issues without further code (e.g. moving the nozzle away from the part). Temp changes are never instantaneous, so usually the first layer is a transition layer where the nozzle is changing temperature. I've never worried about it because I just ignore the first few layers of each zone.

6l17ch
Posts: 3
Joined: Sun Nov 04, 2018 11:28 am

Re: Controlling extruder temp more exactly

Mon Nov 05, 2018 9:08 pm

Happy to clarify what I'm experiencing. It reaches the initial temp fine, begins the print, and then the temps start dropping slowly. By the end of the 260C degree section, it was running about 253-256C if I remember correctly. I saw the target temp change to 255C when it was supposed to. Since the temp at that time was already below this, it didn't attempt to reheat the extruder and continued. It stayed around 253 until the next temp change to 250 where it then started to drift down to 244-246C. Essentially, whatever it was set to, it always seems to be below that temp sometimes by only a few degrees but at times close to 7-8 degrees. It maintained that trend pretty much consistently through the entire print.

I've heard mention of PID curves but have been struggling to get my head around what that was exactly. Is there a way to perform that kind of calibration from within Simplify3d or is it something specific to each printer?

Any help is much appreciated :)

SWCNT
Posts: 27
Joined: Mon Jul 16, 2018 9:51 am

Re: Controlling extruder temp more exactly

Tue Nov 06, 2018 7:27 pm

I would first make sure the Override GcTemp is disabled (should be by default). Most likely that's not the issue, but good to check. Should be in the general settings accessed via the printer LCD screen.
Looking into the issue more, it seems like temp issues are fairly common with Sailfish firmware. Sailfish doesn't implement true PID control, and unlike other firmware, there is no PID autotune feature, so that makes your life a bit more difficult. You'll need to manually change the values to see if the issue gets better or worse.

To make it easier on yourself, I would use RepG program to do this instead of S3D. Then once you have the PID issue fixed, you can go back to S3D. Reason is that most of the online help is talking about RepG menus and options, so it will be easier that way. I would write down your current PID values (Select menu item Machine - Onboard Preferences - Set Extruder Parameters, also where you will go to change the values) before you adjust anything. There's several different starting sets of numbers here: http://makerbot.wikidot.com/pid-controller-tuning that you could try and see if you get lucky. What you want to see is the temperature increase to the set point, slow down as it gets to the set point, then it may go over by a few degrees <5C, then come back down to the set point. After a minute or so it should settle at the set point within 1C.

Regarding your question about what PID actually is--necessary if you are doing manually tuning or you will just spend hours randomly changing values until you get lucky. Proportional-Integral-Differentiate is a very popular control algorithm used for closed-loop systems. Closed-loop means that the system (i.e. motor, current driver, etc) wants to do something (move, heat up, etc) and needs some way to monitor that progress so the system knows when it can stop/start a process. In this case, you have a MOSFET that will supply current to the heater cartridge in your nozzle and the themistor will provide feedback on the progress of the heating. When you first heat up the hotend, the MOSFET should provided about 3.3 amps of current (assuming 12V printer with standard 40W heater cartridge), and the temperature will rise. Now, how does the MOSFET know when to stop supplying current to halt the heating process? Should it go from sending 100% current to 0%? Or does it need to gradually lower the current, and if so, how gradually? These questions are answered through the PID tuning curve. The curve is dictated by 3 values (also see plot attached)
pid.jpg
Proportional Control (Kp)
Proportional control multiplies the error signal (the difference between actual and desired position) by a user-specified gain factor Kp and uses it as a corrective signal to the system. The effective result is to exaggerate the error and react immediately to correct it.
If Kp becomes too large, the thermal system will begin to overshoot, and at some point, it may begin to oscillate, becoming unstable if it has insufficient damping. Kp cannot completely eliminate errors; however, as the following error, e, approaches zero, the proportional correction element, Kpe, disappears. This results in some amount of steady-state error.

Integral Control (Ki)
Integral control accumulates the error signal over time, multiplies the sum by a user-specified gain factor Ki and uses the result as a corrective signal to the thermal system. Since this technique also acts upon past errors, the correction factor does not go to zero as the following error, e, approaches zero allowing steady-state errors to be eliminated.
The integral gain has an important negative side effect. It can be a destabilizing factor for the control loop. Large integral gains or integral gains used without proper damping could cause severe system oscillations.

Derivative Control (Kd)
Derivative control multiples the rate of change of the following error signal by a user-specified gain Kd and uses the result as a corrective signal to the thermal system. Since this type of control acts to stabilize the transient response of a system, it may be thought of as electronic damping.
Increasing the value of Kd increases the stability of the system. The steady-state error, however, is unaffected since the derivative of the steady-state error is zero.

So to address your issue, I would first try to use the values in the link above and see if you get lucky. If not, I would first increase Kp and see if that helps decrease the amount of time it takes to reach the set point, take note of how much it overshoots, like I mentioned earlier 5 or so degrees is ok. But you don't want it going 20C higher than set point. Then watch how it settles to the set point, does it go lower than the set point? If so how much? And does it quickly return to the set point if it goes too low? If it goes above the set point by less than 5C, but drops below by more than 5C, then I would increase Ki, so the high/low swing of your temperature is about equal around your set point. Then if it's oscillating around the set point, the Kd adjustment can help stabilize the reading. Wiki has some practical technical info on PDI tuning here https://en.wikipedia.org/wiki/PID_contr ... ual_tuning
There's a science here, but science is always easier if you're a bit of an artist too ;)

If you're wondering why this is so difficult, most people use Marlin firmware where you can run PID autotune with M303 and the firmware will do this all for you for whatever set point you tell it (optimal PID values change for different set points). So for most users, they run M303 and never need to understand what is actually going on.

Also, buying a silicon sock for your hotend will help a lot with temperature issues caused by the cooling fans.

6l17ch
Posts: 3
Joined: Sun Nov 04, 2018 11:28 am

Re: Controlling extruder temp more exactly

Tue Nov 06, 2018 9:44 pm

SWCNT, you rock! Looks like I've got some homework to do :)

I'll try adjusting those parameters and see if I can hone it in. It's getting late tonight but I'll try to take a stab tomorrow and report back on how it goes. Thank you kindly for taking the time to answer with all that helpful detail :D

wirlybird
Posts: 1238
Joined: Sun Jul 17, 2016 1:32 pm

Re: Controlling extruder temp more exactly

Wed Nov 07, 2018 9:46 am

First thing is on a Tech-1 if you have not switched to all metal hot ends then you have probably done some damage to the PTFE tubes. Max temps is really 230-235 and even then over time the tubes will deteriorate in performance. At 250 you'll cook them.

Return to “General Discussion and Tips”