-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heating Fails after PID takes over #248
Comments
Can you please report this upstream? I try to stay clear of thermal control code. |
I am surprised that noone upstream seems to have noticed this issue. It went so well last time, when you were able to show them the error in their code. I had hoped you could see this one, too. I will give it a go & see what reaction I get. [UPDATE: Upstream ignored the issue I posted, but I found another closed one that sounded very familiar. The way Marlin calculates PID values may be flawed and the way it uses them may also be flawed. Since temperature.cpp continues to “work” for most users and the code is quite arcane, upstream seems loathe to investigate and validate the code. |
Maybe this has something to do with that temperature is now measured in whole integers instead of floats.
Met vriendelijke groet,
Sebastiaan Dammann
…________________________________
Van: Thinkersbluff ***@***.***>
Verzonden: Monday, April 19, 2021 7:07:54 AM
Aan: CR6Community/Marlin ***@***.***>
CC: Sebastiaan Dammann ***@***.***>; Comment ***@***.***>
Onderwerp: Re: [CR6Community/Marlin] Nozzle temperature sometimes cannot reach target - hovers instead about 10 degrees lower until "Heating Failed" timeout (#248)
I am surprised that noone upstream seems to have noticed this issue. It went so well last time, when you were able to show them the error in their code. I had hoped you could see this one, too.
I will give it a go & see what reaction I get.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FCR6Community%2FMarlin%2Fissues%2F248%23issuecomment-822169108&data=04%7C01%7C%7Cc5cfd4de78f145b2158808d902f116ef%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637544056757009039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wb2eE9ArCvYnm9jxRYd%2BxgkZxH8LRrwHIonpsHlUQXQ%3D&reserved=0>, or unsubscribe<https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAK4FMKEPI2LJ53MGQMIY4LTJO3CVANCNFSM43FAHSTA&data=04%7C01%7C%7Cc5cfd4de78f145b2158808d902f116ef%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637544056757009039%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4CB4bmb7CYs9licaoPzm%2BYfxDiwU4dZb17GDrLy6x9I%3D&reserved=0>.
|
I have the same issue. I am using 12 April bug fix. Yesterday I try to do PID but its fails. And it does reach to desire temp. It always below 10 degree. |
@Talha909 Are you using the Community Firmware on a CR6 or are you saying you have a problem running 12 April 2021 Marlin bugfix2.0 on something else? |
I am suspicious of the 10 degrees part. if (temp_hotend[ee].target == 0 If the integer roundoff error were to "trick" PID into turning off the heater too soon, I could understand it cooling when it should be heating. It is beyond my "skills" with software & logic to decide whether that Functional Range parameter (defined as 10 in Configuration.h) could cause the PID routine to settle 10 degrees short of target if round-offs "went the wrong way" during the heating cycle. I know that last test I ran, the PID suddenly went up and achieved target when it had been looking like it would settle 10 deg lower... #define PID_FUNCTIONAL_RANGE 10 I am away from my system today, but am tempted to try redefining that parameter to something like 5 and seeing what happens. [UPDATE: It turned out that I was on the wrong track with this theory, but looking at one of the right parameters. It needed to go higher, not lower] |
I'm using CR6Comm-CF6-Final-cr6-se-v4.5.3-mb-2021-03-27-15-53 and can confirm I too have this issue, I never saw the problem until I got a new 4.5.3 board and upgraded to CR6. The temp drops to 10C below what you set it to and hovers around there on the heating and homing screen until the yellow heating error screen appears shortly after. It is always approx 10C too low and I can consistently reproduce this issue. Interesting theory re 'Functional Range parameter (defined as 10 in Configuration.h)'. |
Workaround for now appears to be:
|
@Sebazzz - I ran some tests today with PID_FUNCTIONAL_RANGE set to 5 instead of 10. [UPDATE: I later found advice that this parameter needed to be larger, not smaller. ] Does it tell you anything important that I was now able to complete a full eSteps calibration, although the temperature never stabilized at 235? (i.e.: Instead of throwing a "Heating Failed" error message, the printer proceeded with the extrusion, then beeped and asked me to measure the remaining filament. ) NOTE: In Test 1, I have just flashed a new build of Rel6.1_Pre2, from the Source.zip files, with the ONLY change being that I have modified the PID_FUNCTIONAL_RANGE parameter from 10 to 5. BUT I forgot to perform a factory reset, so the results may not reflect that change & may be using the previous PID values (I also forgot to query M301 before starting... :( sorry.
[BTW - esteps calibration ignores the filament runout sensor, because I had no filament in the machine & the runout sensor light was out, but the printer said nothing.] |
Here is a second series using PID_FUNCTIONAL_RANGE = 2.
|
In stark contrast to the above demonstrations, PID works correctly in CF6 Prel 6 (pre Marlin bugfix2.0 commit "Add typedef celsius_t MarlinFirmware#21374"): What a difference a few significant figures after the decimal place can make... |
Yep. Working on it. Using "Compare" to try to identify all of the bugfix2.0 commits that differentiate Pre6 from 6 Final. |
You say the issue isn't there in pre6 right? |
It is not there in rel6 pre6 This does seem to implicate the Marlin PR "Add typedef celsius_t (MarlinFirmware#21374)" |
@Thinkersbluff Yes, the Github compare URL just wants two git commit IDs or references to commit ids like branch names, tags etc. |
Perfect, thanks. I used my "new skills" to update the upstream bug. |
I can do the git magic and push a temporary branch. |
I think that would help us corroborate or disprove this theory. I think it would help to be able to say that was the only difference between bug and no bug. |
@Thinkersbluff Pushed a temp/celcius_t branch: If you happen to use a command line git client:
|
You are trying to merge the branch in your local branch. Instead, you need to switch to the branch. |
Ahh yes. Thank you |
There's this universal "law" that my British parents called, "Sod's Law". I just got this result from testing Rel 6 Pre 6: Maybe this demonstrates the Facebook Group's situation, in which a user claims if he does a PID with CF6, he sees this bug, but if he resets to factory settings, his problem goes away... I think the PID function generates p, i & d based on what it had to do to get the nozzle to achieve & stay at target temp. I do not know, yet, whether this is a red-herring generated purely by a bad test procedure or whether this is another useful clue. Thank you for the custom build. |
@Thinkersbluff You are using the BTT SKR board right? Make sure the firmware was flashed (firmware.bin renamed to firmware.cur). On a stock Creality board, I would change the version in Version.h and check afterwards. |
Thanks, yes. I wish it was only that... |
Testing is now showing me that the problem I am able to consistently reproduce is present in both Rel 6 Pre 6 and Rel 6 Pre 6 + PR MarlinFirmware#21374. The perpetual temperature cycling shown in this graph is consistent with the behaviour that some users are describing as, "hovering about 10 degrees below the target temperature". It appears as though the PID routine in the latest bugfix2.0 of Marlin is not generating "effective" PID parameters. |
This upstream issue seems to be related: MarlinFirmware#20463 |
@Sebazzz - I notice that the default PID parameters for the Creality and BTT board machines are different in the CF6 configs, although their stock hotends would be the same. Is this intentional? |
Based on this data, I believe the problem here is that generating the right PID values is not as simple as entering a target temp and pushing the button. I do not yet understand how Marlin decides what parameters to recommend, but I do know that the numbers I am getting with PID E0 S245 C8 U1 are definitely not the right ones.
If anyone else already understands the Classic PID algorithms and/or has a standalone commercial PID system with which they can generate the "right" values here, that would be great. Otherwise, I am packing for a long long long deep dive down a rabbit hole... |
After reviewing this work and recommendations uploaded by descipher on the Marlin bug MarlinFirmware#20463, I ran a couple of tests with two modifications to the Configuration.h settings:
I have made no attempt to optimize these two parameters (PID_K1 & PID_FUNCTIONAL_RANGE), but preliminary testing on my system does suggest that the "bug" we are chasing here may be addressable by tuning the Configuration.h file.
|
In these tests, I evaluated the ability of my printer to heat and stabilize the nozzle at three different print temperatures (235C, 205C and 180C), using the same set of PID parameters at each temperature. In the first plot, the PID values are those currently in the CF6 BTT MB configuration files
|
@Thinkersbluff Thank you for your extensive testing. Can you describe your testing procedure (or I've missed it)? Upstream PR MarlinFirmware#21678 has flowed down to this codebase, so it might be worth re-testing. Make sure you're on the extui branch (if you're still on the temp branch) and then pull in the latest changes. |
The test procedures and logged data are in the text file below each graph. It took me a bit of trial and error to settle on a consistent approach. The PID tests show that Marlin’s Autotune is not delivering “good” parameters with the current default PID_K1 and PID_FUNCTIONAL_RANGE parameters. Changing them both makes the Autotune converge smoothly to target but leaves minor ringing. I will try the latest extui later. All of these tests were done with the integer temperature values, which likely smooths that ringing, but I expect we still need to address those two PID parameters. |
@Thinkersbluff With the latest merges it is even more unstable 😐 |
I think we have to consider that the results I am posting here may only be valid for machines with my configuration. They may even only be valid for my machine. I did not have any failures while running my specific tests. These tests take a lot of time and effort to execute and document, so I am hoping that other users will be willing and able to run similar tests on their systems and give feedback if they have problems.
Here are the plots and data that lead me to recommend that. Once again, the test procedure and the logged results are in the .txt file below the related plot:
|
@Thinkersbluff Please check this - possibly related MarlinFirmware#21743 |
I just got this error |
@Thinkersbluff Merged to extui and extui-bugfix-2.0.x. It seems to me temperature is more stable now. |
Today I made time to test PID and Autotune in Release 6.1, Prerelease 3. I waited too long before capturing the first plot & lost the initial Autotune run with the default PID values, but it did look the same as the curve in the center of the graph. I am not getting Heating Failed warnings any more, but the Autotune is still clearly undershooting twice before achieving the target temperature. |
@maximustiberius - Your curves look similar to those I reported here: I have also been doing PID with the fan off. I have a couple of questions for you that might help the Marlin developers troubleshooting this bug.
I am curious what K values your PID routine generates. Notice that I report my values on the graphs, in case there is a clue in that information. |
i got the heater failed warning a previous time, but in this graph, I cancelled the print!
thanks, paul |
If you do try testing the Creality stock firmware, it would be interesting to know what their default PID values are. |
Not to duplicate information here and on the upstream Marlin version of this report, here is a link to a post I made today documenting the behaviour of my Ender 3 printer PID system, running Marlin 2.0.8 on a BTT SKR E3 Turbo board: Interesting to see that: |
Since the issues are core to Marlin - let's continue the discussion in the upstream issue #21661. The issue does not seem to be necessarily related to the default configurations of the CR-6 Community Firmware. Rather, it seems to be core to something in Marlin. To aid the developers, let's continue the discussion upstream. I'Il leave this issue open however until it is resolved. |
@Sebazzz - I recommend increasing the PID_FUNCTIONAL_RANGE parameter to 50 in Configuration.h |
Alright. Note that will affect bed heating as well. |
It will, if we change the bed heater settings from Bang-Bang to PID. Also Chamber PID and Laser Cooler, I believe. |
Hoping this upstream change is going to make things better. MarlinFirmware#23871 |
UPDATE 27 Aug 2021 - Separate PID RANGE values coming soon. Meantime, good advice from thinkyhead on how best to mitigate this issue on the upstream bug [BUG] "Heating Failed" after PID takes over MarlinFirmware#21661.
Description
The nozzle temperature sometimes fails to reach the target value when heating.
When this is happening, the temperature may climb to within a few degrees of target, but then drops again, cycling around a center value approximately 10 degrees below target. Eventually, the system throws a yellow "Heating Failed" message on the screen and "kills" the job, forcing the user to cycle power to recover.
Steps to Reproduce
I was able to reproduce this problem fairly consistently as follows:
Expected behavior:
At step 5 or step 6, the printer should overshoot 235, and gradually settle on to it, after a ring or two.
Actual behavior:
The printer never gets to the target value.
Logging:
wtf.txt
wtf2.txt
Additional Information
Hardware = Stock Creality Hot End, BTT SKR CR6 v1.0 Motherboard, Stock Creality TFT, Octoprint on RPi3B+
Running this CF6 Pre2 as offered in Assets section, with no mods:
CF6.1-Pre2-btt-skr-cr6-with-stock-creality-tft-2021-04-18-22-12.zip
The text was updated successfully, but these errors were encountered: