PID Tuning not working

Discussion in 'Calibration, Help, and Troubleshooting' started by Madeinoz67, Mar 13, 2016.

Tags:
  1. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    I've been having problems with Temp overruns on prints and my hot end temps are oscillating around the set point by a fairly large amount.

    I've tried to autotune and plugged the results backing the firmware to no avail.

    In this screen shot you can see before, during and after auto tuning and results are no different.

    [​IMG]

    I noticed that while the autotune is running the power output is either 127 or 7 so is effectively acting as a bang/bang controller.

    [​IMG]
     
  2. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    Forgot to mention that Ive checked out and installed the latest Dual Firmware and thats whats currently running
     
  3. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    Exactly the same problem on second hot end

    [​IMG]
     
  4. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    I can't follow your problem:
    Bildschirmfoto 2016-03-13 um 11.07.38.png

    I started PID tuning with
    Code:
    M303 E0 S230 C8
    Then I received the following:
    Code:
    Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from below into Configuration.h
    Recv: #define  DEFAULT_Kp 22.52
    Recv: #define  DEFAULT_Ki 1.66
    Recv: #define  DEFAULT_Kd 76.37
    Instead of editing the firmware right away I set the values with
    Code:
    M301 P22.52 I1.66 D76.37
    and saved them to the EEPROM with
    Code:
    M500
    The result you can see in the picture... Swinging at first about +-3° C while tuning. Then I heated hotend 2 to at first 215° C then to 235° C.
    As you can see the temp is now only +-1° C at max...
     
  5. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    To clarify: autotune with M303 only starts the measuring and you get results back. It does change anything at all. You gotta change it yourself either by doing it with M301 and save to EEPROM with M500 to keep it when restarting the machine or edit the configuration.h of the firmware, recompile and upload it back to the machine...
     
  6. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    Hi Alex, Do you know how to do PID tuning on the second hot end? I have a feeling my behave slightly differently and I'd really like to get the numbers and have them activate during tool change?
     
  7. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    According to http://reprap.org/wiki/PID_Tuning use
    Code:
    M303 E0 S230 C8
    for hotend 1
    Code:
    M303 E1 S230 C8
    for hotend 2 and
    Code:
    M303 E-1 S230 C8
    for bed.
    I actually did the autotune on the hotend 2 but the diagram monitored it as 1, maybe a problem in OctoPrint...

    Currently as you might know Marlin only supports PID values for all hotends, not for each hotend individually. So you got to set the values as you mentioned in the tool change script every time.

    Set the PID values for the hotends with
    Code:
    M301 P1.0 I2.0 D3.0
    and for the bed with
    Code:
    M304 P1.0 I2.0 D3.0
    Insert your actual values from the autotune results in there.

    If you only wanna do it one time remember to save with M500 or via the Control menu on the box...
     
    #7 Alex9779, Mar 13, 2016
    Last edited: Mar 13, 2016
  8. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    Sorry I should have clarified.

    The results I got back from the autotune I put into the firmware Configuration.h file and re-flashed the controller.

    I've also tried via the octoprint Marlin Firmware plugin.

    Will try again using the command line
     
  9. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    This is what I'm expecting to see.
     
  10. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    Ok if you put it in configuration.h and reflashed be sure that your EEPROM does not have stored the old values.
    They are loaded on each startup and overwrite what is set in the firmware.
    Go to the menu, reload defaults then store them again or do a M502 to load defaults followed by M500 to store them again...

    With M501 you can read all the values in the EEPROM with M301 only the PID values for the hotends.
     
    Madeinoz67 likes this.
  11. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    That was my problem, was reading out of Flash not the firmware so doing what you suggested has rectified, thanks
     
    Spoon Unit likes this.
  12. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    Great! Glad you got it working...
     
    Madeinoz67 likes this.
  13. Madeinoz67

    Madeinoz67 Active Member

    Joined:
    Sep 8, 2015
    Messages:
    38
    Likes Received:
    12
    Thanks for pointing me in the right direction :)
     
    Alex9779 likes this.
  14. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,411
    Likes Received:
    735
    Well you got it all right by yourself only problem was your EEPROM. If you would not have stored it since the first flash then it would have worked but I remember that at least in the build manual you are advised to store the values once and that breaks all your attempts changing those values in the firmware itself without loading default values and store them again.

    Just to mention for other reading this: you can also do that with the LCD except the autotune sequence. PID values can be accessed by the control menu where you can check your actually used values...
     
  15. Spoon Unit

    Spoon Unit Well-Known Member

    Joined:
    Sep 6, 2015
    Messages:
    1,561
    Likes Received:
    483
    I've put in an issue against Marlin to request PID tuning from the LCD.
     

Share This Page