Jump to content
Ultimaker Community of 3D Printing Experts
ekh

UMO PID formula error, UMO heated bed upgrade low nozzle temp SOLVED

Recommended Posts

Hi,

I have an UMO with heated bed upgrade.

After the heated bed upgrade was intalled, the temperature regulation was not able to keep the setpoint temperature, but it typically was 20 C too low.

The probable cause is insufficient total loop amplification due to a bit lower supply voltage due the the load from the heated bed. It could also be changes in the sw for the upgrade. I have not digged into that.

But no matter how high I set the integral value it was not able to regulate correctly.

I looked at the newest firmware (Github checkout 2015-0704).

The problem is that Ki is not part of the PID formula.

In the file temperature.cpp, change line 438 from:

temp_iState[e] += pid_error[e];

to

temp_iState[e] += Ki * pid_error[e];

With PID constants:

Kp = 16.67

Ki = 2.00

Kd = 114.00

The regulation works as it should, I have not spent much time finding these constants, so they are probably not optimal, but they are sufficient to make it work.

Ekh

Edited by Guest
  • Like 1

Share this post


Link to post
Share on other sites

Let me quote myself:

 

The probable cause is insufficient total loop amplification

This was correct, but it was not the supply woltage, but the nozzle heater element that was worn out. The resistance was 10ohm

I checked that even when the FET was on all the time the temperature was too low.

The printer has for long periods worked 24/7 and the heater element has been worn out. In another post I blamed the FET because it has failed once before, but not this time.

Another heating element I bought for making my own printer is only 4ohm.

So the loop amplification was more than halved (10/4 = 2.5 times assuming the original heater also was 4ohm).

That is why I was the only one suffering from the error in the PID formula.

Share this post


Link to post
Share on other sites

Okay - I looked at this code just now and I disagree.  There was no bug.  The Ki term is used 2 lines of code below:

 

iTerm[e] = Ki * temp_iState[e];

 

Your now multiplying by Ki twice.  This means your ki value instead of being set to 2 is actually the equivalent of being set to ki squared or 4.

If you change the code back to the official code and set I=4.0 in your PID settings you should get the same results.

Edited by Guest
  • Like 1

Share this post


Link to post
Share on other sites

Just to help you understand the code, the variable temp_iState[0] stores the error each time through the loop. It is the integration or the sum of the error.

then iterm[0] is set to this error multiplied by Ki and added into the terms for the pid_output variable which sets the power to the heater.

Share this post


Link to post
Share on other sites

You are right.

Somehow I wanted to multiply before summation, but the official formula sums the error and multiplies afterwards.

I suffered from the end of life heater and "now it works" syndrome, instead of going more thorougly through the code.

Please acceept my apologies for having wasted your time.

By the way the 4ohm heater element draws too much current for the power supply, it resets randomly within the first few minutes of a print. I also added the suggested change to the FET driver circuit, to avoid problems with the FET driving the low ohmage.

After replacing the power supply with a 480W supply, the UMO has worked like a charm the last 72 hours.

On the plus side it heats the nozzle approx. as fast as the UM2.

But I still nedd to print 2 * 500 hours to finish my order.

That is why I want to build 10 printers myself with a little bit better properties for 24/7 printing, e.g. end stop on filament.

My next order is 3000 hours of printing.

But again thank you for being thorough and checking me.

Share this post


Link to post
Share on other sites

It was no trouble - I had to make edits in that part of the code for another experiment I'm doing anyway.

Maybe you should know that there is also a setting in configuration.h:

 

#define PID_MAX 255

 

Just for this kind of thing (power supplies that can't quite deliver) to keep the power down a bit on the nozzle. I'm not sure but if you alter that one you should alter the line above it also:

 

#define BANG_MAX 255

 

Share this post


Link to post
Share on other sites

Thank you for helping :-)

The BANG_MAX is in use when the reguation (e.g. during initial heating) is not used or outside bounds if I got it right, while PID_MAX is the max PID output during regulation.

So you are right that both values must be changed, if I will use the (weak) original power supply again.

But because the PWM frequency is so low, maybe the power supply will fail anyway within the time the PWM pulse is on.

Share this post


Link to post
Share on other sites

But because the PWM frequency is so low, maybe the power supply will fail anyway within the time the PWM pulse is  on.

 

Yes. I had the same thought. The frequency is around 10 or 20 times per second (you can see the LEDs flashing on the UM2 when the bed is close to the correct temperature - that's how I know the frequency).

25-50ms (the "on" time) might be long enough to make the power supply "barf". Or maybe not - there might be a very large capacitor that can handle increased current for that long.

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

  • Our picks

    • Taking Advantage of DfAM
      This is a statement that’s often made about AM/3DP. I'll focus on the way DfAM can take advantage of some of the unique capabilities that AM and 3DP have to offer. I personally think that the use of AM/3DP for light-weighting is one of it’s most exciting possibilities and one that could play a key part in the sustainability of design and manufacturing in the future.
        • Like
      • 3 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!