Jump to content
Ultimaker Community of 3D Printing Experts
Sign in to follow this  
nick-wong

Regarding PID auto tune with UM2

Recommended Posts

Hi all! Recently I was trying to mount a E3D hotend onto the UM2, which means PID tuning is needed. Yet I have trouble implementing the "M303" command for PID auto tune. I typed in "M303 C8 S175" on notepad, saved it as .GCODE on a SD card and tried to run the file with the "Print" option with UM2. But the printer would not execute the command and only shows "print finished" at the end.

So apparently I am doing it wrong, but is there any other way by which I could implement a gcode on UM2? If yes, how?

Sincerely

Nicholas

 

Share this post


Link to post
Share on other sites

You can also go into Cura and File -> Preferences and set the print window type to Pronterface. Then use File -> Print (even if no model is loaded, cntl-p I believe on windows) to open the Pronterface like UI.

On the bottom right is a box to enter commands and above it is the output of the printer. Issue your "M303 C8 S175" command in the bottom right box and wait for the printer to do it's thing. The PID autotune will output the P,I and D values to set in the printer output in the box above the command box.

 

Share this post


Link to post
Share on other sites

Many people have had trouble tuning other hot ends. You might want to learn the wattage of the UM2 hot end versus the E3D and scale all the values accordingly. For example if your hotend is double the wattage (at 19V) then cut all 3 PID values by half.

Also PID doesn't kick in until around 10 or 20C from the goal voltage. Some people had better luck tuning if they started with a higher temperature when they started tuning. Or tuning to a lower temperature (because it can error out if it gets over 250C). I don't know if that makes sense. There is a fantastic article on PID, how it works and how to do manual tuning on wikipedia.

 

Share this post


Link to post
Share on other sites

If you do use pronterface it will tell you the current PID values when you connect to the printer and you can see the results after tuning. And I think after doing autotune you still have to issue another command to save the values. Maybe. So doing it through pronterface might be better than cura print window (not sure). Also through pronterface you can then power cycle the printer and see if the PID values were changed properly.

pronterface is here:

http://koti.kapsi.fi/~kliment/printrun/

 

 

Share this post


Link to post
Share on other sites

I don't believe there is anything special in Pronterface that couldn't be done in the built-in Pronterface Cura Print UI.

Use M503 to get the current settings. It dumps everything but the output will currently have the PID values somewhere.

Run the autotune via M303

At the end of the autotune run, it will tell you the values to use in the output display in the Cura Pronterface Print UI.

Set them in memory using

M301 P<value> I<value> D<value>

where the values are those reported after the M303 run.

The values are now set in memory. To store them (AND ALL OTHER CHANGES!):

M500

If you want to power cycle and the electronics support it (the UM1 doesn't):

Power off

M81

Power on

M80

Then use

M503

to verify the PID values are in effect.

I haven't seen any problems starting with a cold hot end. However, you can always do the first PID autotune then let the hotend cool some and do it again and see if the values are significantly different. Every run generates slightly different values.

Finally, I don't believe mathematically that the PID values are proportional to power since the I and D are integral and derivation and those aren't typically proportional operations. Furthermore, it's not just about power in but also thermal mass and radiated heat loss which for the E3D end is probably significantly different than the stock hotend.

 

Share this post


Link to post
Share on other sites

I haven't used the new cura print window so thanks for clarifying.

duty cycle/percentage power applied = pconst*P+iconst*I+dconst*D

Where P,I,D are the current error, integral (sum) of all past error and derivative (slope or rate of change) of error respectively. So definitely reducing all 3 by power capability is a good first guess.

Oh and error is (goal temp - current temp).

But, yes, it's true that it matters how long it takes for a change in power to reflect in the sensor readings. This delay is very important for setting D setting particularly but also P and I. They are all interrelated - it's hard to adjust one parameter without messing up the other 2. In general if you are overshooting, reduce P or I or increase D.

I'm told E3D tends to overshoot/oscillate massively.

Also you might have to reduce the "max power" setting but that requires a firmware change. This has helped other's in the past. Because by the time the PID feature kicks in often it's already too late - it's going to overshoot (I don't understand why PID only kicks in within 10 or 20C of the goal temp - this seems wrong).

 

Share this post


Link to post
Share on other sites

Still not sure about your proportional change of the three constants. PIDs are one of those things that seem to be almost magic to me... I guess reducing the constants is a good first step for manual tuning.

However, I'll just let autotune figure it out for me... you know like

(oooo that's bad).

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Our picks

    • Ultimaker Cura | a new interface
      We're not only trying to always make Ultimaker Cura better with the usual new features and improvements we build, but we're also trying to make it more pleasant to operate. The interface was the focus for the upcoming release, from which we would already like to present you the first glance. 
        • Like
      • 9 replies
    • "Back To The Future" using Generative Design & Investment Casting
      Designing for light-weight parts is becoming more important, and I’m a firm believer in the need to produce lighter weight, less over-engineered parts for the future. This is for sustainability reasons because we need to be using less raw materials and, in things like transportation, it impacts the energy usage of the product during it’s service life.
        • Like
      • 12 replies
×

Important Information

Welcome to the Ultimaker Community of 3D printing experts. Visit the following links to read more about our Terms of Use or our Privacy Policy. Thank you!