Jump to content

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


ekh

Recommended Posts

Posted (edited) · UMO PID formula error, UMO heated bed upgrade low nozzle temp SOLVED

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
Link to post
Share on other sites

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

Wow. I'm going to look into this for sure. On my list. I haven't had this problem on my UMO so I may have a different version than you. It basically implies Ki=1 if you are correct.

  • Link to post
    Share on other sites

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

    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.

  • Link to post
    Share on other sites

    Posted (edited) · UMO PID formula error, UMO heated bed upgrade low nozzle temp SOLVED

    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
    Link to post
    Share on other sites

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

    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.

  • Link to post
    Share on other sites

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

    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.

  • Link to post
    Share on other sites

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

    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

     

  • Link to post
    Share on other sites

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

    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.

  • Link to post
    Share on other sites

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

    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.

  • 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

      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 18 replies
      • S-Line Firmware 8.3.0 was released Nov. 20th on the "Latest" firmware branch.
        (Sorry, was out of office when this released)

        This update is for...
        All UltiMaker S series  
        New features
         
        Temperature status. During print preparation, the temperatures of the print cores and build plate will be shown on the display. This gives a better indication of the progress and remaining wait time. Save log files in paused state. It is now possible to save the printer's log files to USB if the currently active print job is paused. Previously, the Dump logs to USB option was only enabled if the printer was in idle state. Confirm print removal via Digital Factory. If the printer is connected to the Digital Factory, it is now possible to confirm the removal of a previous print job via the Digital Factory interface. This is useful in situations where the build plate is clear, but the operator forgot to select Confirm removal on the printer’s display. Visit this page for more information about this feature.
          • Like
        • 0 replies
    ×
    ×
    • Create New...