Skip to content
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

PID tuning both extruder / bed tuning"hangs" after reaching targeted bed temperature #26

Open
ruedli opened this issue Aug 17, 2021 · 52 comments

Comments

@ruedli
Copy link

ruedli commented Aug 17, 2021

Tried this 3 times now, on Prusa MK3S / MMU2S latest firmware.
Plugin version 1.01
octoprint 1.7.0rc2

The extruder temperature seems to go though the tuning process, but the BED tuning never ends. I waited more than 25 minutes, no indication this will finish any time soon.

image

Let me know if further information is needed.

@iFrostizz
Copy link
Owner

Hi, why is the bed tuning "hanging" ? Does it seems to never end on the plugin interface, or on your printer screen ?
On the logs side, it looks good: the 5 cycles are done and finishes with Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
The only thing is that the bed temperature seems to stay at 60°C after that the autotune has finished.

@iFrostizz
Copy link
Owner

Indeed, the progress bar is staying at 100% when the PID process is finished, and should go back to 0 instead. The only time when it goes at 0 is when a new PID autotune is started.
But I don't understand how the bed temperature could stay at 60°C as if a "M190 ....." was sent to the printer, which the plugin is not doing. The only M190 that is in the code is in the start gcode, which is not triggered in this case. I'm not sure if this is a side effect of the M303 command, but if it's the case I will add the command to stop the bed heating.
Your idea of displaying the PID constants is good, I'll do that for the next update as a notification at the end of the PID autotune.

@iFrostizz
Copy link
Owner

@ruedli
That's a very good find, so it looks like the pid_tuning_finished boolean is set to true after that the PID tuning has been finished. I found that then: https://github.com/prusa3d/Prusa-Firmware/blob/538ce06bf036eb45b0b3bbef6fa50bd694f0c3a3/Firmware/ultralcd.cpp#L1330
Looks like the hotend(s) are all set to 0 °C in this line:

setAllTargetHotends(0); // reset all hotends temperature including the number displayed on the main screen
but the:
setTargetBed(0);

is indeed not called. So this sentence from you:

However it ALSO applies to extruder heating, not just bed heating

makes me doubt now...
If it is the case, maybe that this is either not the place where the PID is finished in the code, or an error in the code...
Maybe that it's a choice from the Prusa devs ? In this case, I don't really see why they have done that. If maybe you can confirm that the hotend is shut down, I will open an issue on their repo linking this issue. If not, I will simply set hotends and bed to 0°C in my plugin. I don't think that it would cause any UX issue.

Do you have the "PID cal. finished" message writter on your screen after the process by the way ?

@ruedli
Copy link
Author

ruedli commented Aug 21, 2021

@iFrostizz I can test again tomorrow, but the fact that it sits in the lcd module makes me wonder. Either bad programming, or they are indeed just talking about targets set to display on the lcd. I mean: if you need to program temperature stuff, why rely on a call in the module that does lcd stuff? ultralcd did not come from marlin I believe, so there is potential for error here. ;-) After testing I can tell you more...

@ruedli
Copy link
Author

ruedli commented Aug 22, 2021

@iFrostizz

And.... this leaves me to another observation, maybe storing the obtained PID values fails? I mean I get from the log 3 sets of PID, and instructions to store the last triple in the configuration file. When I do an M503, the reported PID values do not match the PID tuning.

image

Is there an easy explanation for this? Are you perhaps omitting the U1 option to use the result? Should another "issue" be opened for this observation?

I did a M301 P21.42 I2.15 D53.38 followed by an M500 and after that M503 shows the obtained PID values. Is this a bug in the plugin? I was under the impression that your pluging stores the obtained PID values, but it seems to skip the M301 (and perhaps the M304 for the bed as well).

Note that not all firmware supports U1, so relying on that might not be a good idea.

The result of the newly stored parameters is this, I guess these PID's are better then what I started with?

image

@iFrostizz
Copy link
Owner

Hi @ruedli,
I ran a PID autotune from the plugin, we can see the 5 cycles here:
image
And at the end of the PID, the constants are stored (in the volatile memory) and the temperature target will drop at 0 °C automatically.
image
I'm using Marlin 2.0.7.2, which may be part of the changes from Marlin 1.x.x which is the based version of Prusa firmware.

The firmware for the Original Prusa i3 printers is proudly based on Marlin 1.0.x by Scott Lahteine

from https://github.com/prusa3d/Prusa-Firmware#prusa-firmware-mk3

As far as I can see, I haven't found the part containing the #define Kp ... where the constants are waiting for an M500 to store them in the EEPROM on your screenshot.
I also found a tutorial on this link: https://www.snazzyit.com/pid-calibration-for-prusa-i3-mk2s-mk3-3d-printer/ explaining how to PID tune a MK2s/MK3 (might be including MK3s from your observations), and the constants are not stored there neither. We need to use M301.
So! I will probably also need to add the M301 ... command in the next update, as well as cooling down the extruder/bed before storing the data for Prusa users.

@ruedli
Copy link
Author

ruedli commented Aug 23, 2021

@iFrostizz

As far as I can see, I haven't found the part containing the #define Kp ...

Yes, this is not displayed from my firmware.

Yes, the fork for Prusa from Marlin is quite dated. Over that period, the two branches quite diverted, so what works in one branch is not necessarily working in the other. I just did a PID by issuing an M303, using U1. It definitely does not store.. And you see: after the tuning your "target" temperature reported to octoprint is 0. Mine stays at the PID tuning temperature... I am still seeing 2 degrees of overshoot. Will reduce P a bit and see if that's better. Maybe the Prusa algorithm is flawed somehow. I can see in your graph that after each cycle the result is slightly better. For me that seems not the case.

@iFrostizz
Copy link
Owner

@ruedli
Maybe trying Marlin 2.0 would be a solution...
Anyway, thanks for that reporting this issue!

@iFrostizz
Copy link
Owner

@ruedli
I merged the update some days ago in the "devel" branch if you wish to test it. If not, I will pull request into the main branch after adding more nozzle sizes in some days.

@ruedli
Copy link
Author

ruedli commented Aug 31, 2021

@iFrostizz

Thank François,

I installed the 1.02 from the devel branch, but the temperature is NOT reset, nor are the PID values stored.

image

I ensured the mark was set for storing the PID parameters, however, I do not think they are actually stored. I did an M503 afterwards. I think the PIDs are not stored? Af far as I can see you reset the fan speed, but not the temperature, as I do not see an M104 S0. As soon as I manually provide that gcode, temperature goes down. Was that not supposed to be done in your devel branch?

As far as I can see, you are not setting the U1 parameter when you issue the PID autotune M303.

image

This are the parameters I think:

image

Here is the full log.

Recv: T:44.2 /0.0 B:36.0 /0.0 T0:44.2 /0.0 @:0 B@:0 P:25.8 A:38.5
Recv: T:44.2 /0.0 B:36.0 /0.0 T0:44.2 /0.0 @:0 B@:0 P:25.8 A:38.2
Recv: T:44.0 /0.0 B:35.8 /0.0 T0:44.0 /0.0 @:0 B@:0 P:25.7 A:38.4
Recv: T:43.9 /0.0 B:35.9 /0.0 T0:43.9 /0.0 @:0 B@:0 P:25.8 A:38.4
Recv: T:43.8 /0.0 B:35.9 /0.0 T0:43.8 /0.0 @:0 B@:0 P:25.8 A:38.3
Recv: T:43.6 /0.0 B:35.9 /0.0 T0:43.6 /0.0 @:0 B@:0 P:25.8 A:38.0
Send: M106 S255
Recv: ok
Recv: T:43.6 /0.0 B:35.7 /0.0 T0:43.6 /0.0 @:0 B@:0 P:25.8 A:38.1
Send: M303 E0 C10 S215
Recv: PID Autotune start
Recv: T:43.33 @:127
Recv: T:44.81 @:127
Recv: T:49.02 @:127
Recv: T:54.14 @:127
Recv: T:59.53 @:127
Recv: T:65.43 @:127
Recv: T:71.72 @:127
Recv: T:77.01 @:127
Recv: T:83.05 @:127
Recv: T:88.21 @:127
Recv: T:93.97 @:127
Recv: T:99.53 @:127
Recv: T:104.54 @:127
Recv: T:109.95 @:127
Recv: T:115.38 @:127
Recv: T:119.84 @:127
Recv: T:125.09 @:127
Recv: T:129.38 @:127
Recv: T:134.44 @:127
Recv: T:139.06 @:127
Recv: T:143.49 @:127
Recv: T:148.24 @:127
Recv: T:152.94 @:127
Recv: T:156.91 @:127
Recv: T:161.18 @:127
Recv: T:165.20 @:127
Recv: T:169.30 @:127
Recv: T:173.70 @:127
Recv: T:177.41 @:127
Recv: T:181.45 @:127
Recv: T:185.77 @:127
Recv: T:189.20 @:127
Recv: T:193.16 @:127
Recv: T:196.88 @:127
Recv: T:199.93 @:127
Recv: T:204.15 @:127
Recv: T:207.50 @:127
Recv: T:210.99 @:127
Recv: T:214.74 @:127
Recv: T:217.66 @:0
Recv: T:219.84 @:0
Recv: T:220.25 @:0
Recv: T:219.11 @:0
Recv: T:217.29 @:0
Recv: T:214.90 @:127
Recv: T:212.34 @:127
Recv: T:210.73 @:127
Recv: T:211.30 @:127
Recv: T:213.39 @:127
Recv: T:215.89 @:0
Recv: T:218.39 @:0
Recv: T:219.58 @:0
Recv: T:219.17 @:0
Recv: T:217.86 @:0
Recv: T:215.57 @:0
Recv: bias: 116 d: 116 min: 210.73 max: 219.79
Recv: T:213.39 @:116
Recv: T:211.04 @:116
Recv: T:210.52 @:116
Recv: T:211.67 @:116
Recv: T:213.75 @:116
Recv: T:216.35 @:0
Recv: T:218.39 @:0
Recv: T:218.59 @:0
Recv: T:217.81 @:0
Recv: T:216.15 @:0
Recv: bias: 117 d: 117 min: 210.26 max: 218.91
Recv: T:213.49 @:117
Recv: T:211.72 @:117
Recv: T:211.09 @:117
Recv: T:212.29 @:117
Recv: T:214.22 @:117
Recv: T:216.67 @:0
Recv: T:218.39 @:0
Recv: T:218.59 @:0
Recv: T:217.60 @:0
Recv: T:215.57 @:0
Recv: bias: 116 d: 116 min: 211.09 max: 218.80
Recv: Ku: 38.32 Tu: 19.66
Recv: Classic PID
Recv: Kp: 22.99
Recv: Ki: 2.34
Recv: Kd: 56.51
Recv: T:213.44 @:116
Recv: T:211.41 @:116
Recv: T:211.35 @:116
Recv: T:212.50 @:116
Recv: T:214.74 @:116
Recv: T:217.14 @:0
Recv: T:218.33 @:0
Recv: T:218.33 @:0
Recv: T:217.34 @:0
Recv: T:215.10 @:0
Recv: bias: 115 d: 115 min: 210.94 max: 218.70
Recv: Ku: 37.74 Tu: 19.67
Recv: Classic PID
Recv: Kp: 22.64
Recv: Ki: 2.30
Recv: Kd: 55.68
Recv: T:212.40 @:115
Recv: T:211.09 @:115
Recv: T:211.25 @:115
Recv: T:212.40 @:115
Recv: T:215.05 @:0
Recv: T:217.14 @:0
Recv: T:218.28 @:0
Recv: T:217.81 @:0
Recv: T:216.35 @:0
Recv: bias: 116 d: 116 min: 210.73 max: 218.33
Recv: Ku: 38.85 Tu: 19.15
Recv: Classic PID
Recv: Kp: 23.31
Recv: Ki: 2.43
Recv: Kd: 55.78
Recv: T:214.53 @:116
Recv: T:211.98 @:116
Recv: T:211.46 @:116
Recv: T:212.03 @:116
Recv: T:213.85 @:116
Recv: T:215.73 @:0
Recv: T:218.28 @:0
Recv: T:218.65 @:0
Recv: T:217.92 @:0
Recv: T:215.94 @:0
Recv: bias: 115 d: 115 min: 211.09 max: 218.85
Recv: Ku: 37.74 Tu: 19.67
Recv: Classic PID
Recv: Kp: 22.64
Recv: Ki: 2.30
Recv: Kd: 55.67
Recv: T:213.80 @:115
Recv: T:211.41 @:115
Recv: T:210.94 @:115
Recv: T:211.93 @:115
Recv: T:214.06 @:115
Recv: T:216.51 @:0
Recv: T:217.86 @:0
Recv: T:218.54 @:0
Recv: T:217.55 @:0
Recv: T:215.99 @:0
Recv: bias: 115 d: 115 min: 210.78 max: 218.85
Recv: Ku: 36.28 Tu: 19.93
Recv: Classic PID
Recv: Kp: 21.77
Recv: Ki: 2.18
Recv: Kd: 54.22
Recv: T:213.70 @:115
Recv: T:211.51 @:115
Recv: T:211.09 @:115
Recv: T:212.08 @:115
Recv: T:214.06 @:115
Recv: T:216.46 @:0
Recv: T:218.18 @:0
Recv: T:218.59 @:0
Recv: T:217.60 @:0
Recv: T:215.57 @:0
Recv: bias: 116 d: 116 min: 210.73 max: 218.70
Recv: Ku: 37.07 Tu: 19.67
Recv: Classic PID
Recv: Kp: 22.24
Recv: Ki: 2.26
Recv: Kd: 54.68
Recv: T:213.44 @:116
Recv: T:211.51 @:116
Recv: T:211.61 @:116
Recv: T:212.76 @:116
Recv: T:214.84 @:116
Recv: T:217.24 @:0
Recv: T:218.96 @:0
Recv: T:218.59 @:0
Recv: T:217.45 @:0
Recv: T:215.26 @:0
Recv: bias: 113 d: 113 min: 211.20 max: 218.96
Recv: Ku: 37.08 Tu: 19.93
Recv: Classic PID
Recv: Kp: 22.25
Recv: Ki: 2.23
Recv: Kd: 55.43
Recv: T:212.86 @:113
Recv: T:210.89 @:113
Recv: T:211.04 @:113
Recv: T:212.55 @:113
Recv: T:214.38 @:113
Recv: T:216.98 @:0
Recv: T:217.92 @:0
Recv: T:218.28 @:0
Recv: T:217.03 @:0
Recv: T:215.21 @:0
Recv: bias: 114 d: 114 min: 210.89 max: 218.28
Recv: Ku: 39.25 Tu: 19.68
Recv: Classic PID
Recv: Kp: 23.55
Recv: Ki: 2.39
Recv: Kd: 57.92
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Send: M500
Recv: T:214.8 /215.0 B:31.2 /0.0 T0:214.8 /215.0 @:114 B@:0 P:24.7 A:37.6
Recv: echo:Settings Stored
Recv: ok
Send: M106 S0
Recv: ok
Recv: T:212.1 /215.0 B:31.3 /0.0 T0:212.1 /215.0 @:0 B@:0 P:24.8 A:37.6
Recv: T:210.0 /215.0 B:31.2 /0.0 T0:210.0 /215.0 @:0 B@:0 P:24.8 A:37.6
Recv: T:208.3 /215.0 B:31.1 /0.0 T0:208.3 /215.0 @:0 B@:0 P:24.9 A:37.5
Recv: T:206.4 /215.0 B:31.1 /0.0 T0:206.4 /215.0 @:0 B@:0 P:24.8 A:37.7
Recv: T:204.7 /215.0 B:31.1 /0.0 T0:204.7 /215.0 @:0 B@:0 P:24.8 A:37.6

Send: M503
Recv: echo:Steps per unit:
Recv: echo: M92 X100.00 Y100.00 Z400.00 E415.00
Recv: echo:UStep resolution:
Recv: echo: M350 X16 Y16 Z16 E16
Recv: echo:Maximum feedrates - normal (mm/s):
Recv: echo: M203 X200.00 Y200.00 Z12.00 E120.00
Recv: echo:Maximum feedrates - stealth (mm/s):
Recv: echo: M203 X100.00 Y100.00 Z12.00 E120.00
Recv: echo:Maximum acceleration - normal (mm/s2):
Recv: echo: M201 X1000 Y1000 Z200 E5000
Recv: echo:Maximum acceleration - stealth (mm/s2):
Recv: echo: M201 X960 Y960 Z200 E5000
Recv: echo:Acceleration: P=print, R=retract, T=travel
Recv: echo: M204 P1000.00 R1250.00 T1000.00
Recv: echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
Recv: echo: M205 S0.00 T0.00 B0.00 X8.00 Y8.00 Z0.40 E4.50
Recv: echo:Home offset (mm):
Recv: echo: M206 X0.00 Y0.00 Z0.00

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! vvvvvvvvv !!!!!!!!!!!!!!!!!!!!!!

Recv: echo:PID settings:
Recv: echo: M301 P20.50 I2.08 D50.42

image

@iFrostizz
Copy link
Owner

@ruedli
Sorry for that, I forgot to set the temperature at 0.
Did you activated the checkbox below the PID configuration to store the values automatically?

@ruedli
Copy link
Author

ruedli commented Aug 31, 2021 via email

@iFrostizz
Copy link
Owner

iFrostizz commented Aug 31, 2021

@ruedli Okay, I know why.
Another "Marlin 1.x.x doesn't like marlin 2.x.x" because how I handled it was to wait for the line "Recv: Kp: xx Ki: xx Kd:xx", and wait for the PID to actually finish to send the lastly found values. In your case, you are getting this instead:

"Recv: Kp: xx"
"Recv: Ki: xx"
"Recv: Kd: xx"

in separated lines. I will find a workaround

@iFrostizz
Copy link
Owner

I hope that it is fixed now. If it worked, you cannot miss it... A message should appear
image

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

@iFrostizz

Hi François

Almost, but not there yet ;-)

Temperature goes down, there is an attempt to store the Pid values, but the values were undefined and consequently failed.

This is the log now, as well as the M503 output to verify what was stored: all zeroes.

Recv: T:88.8 /0.0 B:21.5 /0.0 T0:88.8 /0.0 @:0 B@:0 P:23.6 A:32.4
Recv: T:88.2 /0.0 B:21.4 /0.0 T0:88.2 /0.0 @:0 B@:0 P:23.6 A:32.3
Send: M303 E0 C5 S215
Recv: PID Autotune start
Recv: T:87.02 @:127
Recv: T:87.75 @:127
Recv: T:90.83 @:127
Recv: T:94.62 @:127
Recv: T:99.54 @:127
Recv: T:104.82 @:127
........
Recv: T:217.76 @:0
Recv: T:215.94 @:0
Recv: bias: 115 d: 115 min: 210.63 max: 218.75
Recv: Ku: 36.04 Tu: 20.19
Recv: Classic PID
Recv: Kp: 21.63
Recv: Ki: 2.14
Recv: Kd: 54.59
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Recv: T:214.6 /215.0 B:21.5 /0.0 T0:214.6 /215.0 @:115 B@:0 P:24.1 A:33.9
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M106 S0
Recv: ok
Send: M301 E0 Pundefined Iundefined Dundefined
Recv: ok p:0.00 i:0.00 d:0.00 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Send: M301 E0 Pundefined Iundefined Dundefined
Recv: ok p:0.00 i:0.00 d:0.00 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok

Recv: T:212.4 /0.0 B:21.5 /0.0 T0:212.4 /0.0 @:0 B@:0 P:24.1 A:33.7
21.6 /0.0 T0:201.3 /0.0 @:0 B@:0 P:24.1 A:33.5
Recv: T:199.5 /0.0 B:21.6 /0.0 T0:199.5 /0.0 @:0 B@:0 P:24.1 A:33.8

Output from the M503:

Recv: echo:PID settings:
Recv: echo: M301 P0.00 I0.00 D0.00

Conclusion: Almost, but not there yet ;-)

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

The message after calibration pops up, then disappears after a few seconds. As far as I could see, it did not have correct PID values though. Is that my settings, or do you intend it to popup and disappear that way?

@iFrostizz
Copy link
Owner

Very probably an error in the code that is picking up the values from the received gcode commands. It is meant to fade out, but maybe that it makes more sense to let it "pinned" ?

@iFrostizz
Copy link
Owner

iFrostizz commented Sep 1, 2021

@ruedli I hope that it's fine now..

edit:
I see that at the end of your logs:

Send: M301 E0 Pundefined Iundefined Dundefined
Recv: ok p:0.00 i:0.00 d:0.00 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Send: M301 E0 Pundefined Iundefined Dundefined
Recv: ok p:0.00 i:0.00 d:0.00 c:1.00

Looks like the M301 has been sent twice, tough the Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h has been received once. Could that be your error from copy/paste ?

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021 via email

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

OK, think you nailed it now. And.. pinned dialog is better ;-)

Verified the settings, they were stored...

Nasty one, but glad we could work it out!

Cheers Ruud

Recv: bias: 67 d: 67 min: 212.55 max: 217.34
Recv: Ku: 35.61 Tu: 19.67
Recv: Classic PID
Recv: Kp: 21.36
Recv: Ki: 2.17
Recv: Kd: 52.53
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Send: M500
Recv: T:214.9 /215.0 B:21.2 /0.0 T0:214.9 /215.0 @:67 B@:0 P:23.9 A:28.7
Recv: echo:Settings Stored
Recv: ok
Send: M106 S0
Recv: ok
Send: M301 E0 P21.36 I2.17 D52.53
Recv: ok p:21.36 i:2.17 d:52.53 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0

@ruedli ruedli closed this as completed Sep 1, 2021
@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Ooopsss...

After the extruder tuning I did a (bed only) tuning. It ruined the PID settings for the extruder...

This seems OK:

ecv: B:60.36 @:0
Recv: B:60.34 @:0
Recv: B:60.23 @:0
Recv: B:60.13 @:0
Recv: bias: 57 d: 57 min: 59.44 max: 60.60
Recv: Ku: 124.83 Tu: 48.26
Recv: Classic PID
Recv: Kp: 74.90
Recv: Ki: 3.10
Recv: Kd: 451.82
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Recv: T:33.0 /0.0 B:59.9 /60.0 T0:33.0 /0.0 @:0 B@:57 P:27.0 A:38.1
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M301 E-1 P74.90 I3.10 D451.82
Recv: ok p:74.90 i:3.10 d:451.82 c:1.00
Send: M500
Recv: ok
Send: M140 S0
Recv: echo:Settings Stored
Recv: ok

But when I check my settings with M503 I get:

ecv: echo:PID settings:
Recv: echo: M301 P74.90 I3.10 D451.82
Recv: echo:PID heatbed settings:
Recv: echo: M304 P88.01 I3.90 D496.19

Not sure how the extruder ones got changed... Did not do anything manually. Can you reproduce this?

image

@ruedli ruedli reopened this Sep 1, 2021
@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

The OTHER window in which I had octoprint open (not on the calibration tab) reported this:

image

No idea where it picked this up, but this is where the wrong settings came from after bed-only-tuning

@iFrostizz
Copy link
Owner

iFrostizz commented Sep 1, 2021

Well, it looks like I'm sending M301 for the bed and for the extruder too. And the gcode to send is M304, the index for extruders is between 0 to ... So at this point, I'm not sure about the behavior of the firware if it's sending M301 E-1 ..., maybe that's flushing the values like that ?

@iFrostizz
Copy link
Owner

I pushed the update, could you please try ?

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

I am now issuing both extruder/bed tuning. The be tuning finished. On the window of the calibration I have:

image

But on the OTHER window I have:

image

That's a bit strange isn't it?

@iFrostizz
Copy link
Owner

It is, could I see your logs please ?

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

ecv: B:60.53 @:0
Recv: B:60.45 @:0
Recv: B:60.34 @:0
Recv: B:60.23 @:0
Recv: B:60.14 @:0
Recv: B:60.00 @:0
Recv: bias: 55 d: 55 min: 59.48 max: 60.54
Recv: Ku: 132.30 Tu: 45.37
Recv: Classic PID
Recv: Kp: 79.38
Recv: Ki: 3.50
Recv: Kd: 450.17
Recv: B:59.91 @:55
Recv: B:59.80 @:55
Recv: B:59.63 @:55
Recv: B:59.58 @:55
Recv: B:59.55 @:55
Recv: B:59.48 @:55
Recv: B:59.52 @:55
Recv: B:59.53 @:55
Recv: B:59.69 @:55
Recv: B:59.70 @:55
Recv: B:59.81 @:55
Recv: B:59.89 @:55
Recv: B:60.14 @:0
Recv: B:60.25 @:0
Recv: B:60.31 @:0
Recv: B:60.57 @:0
Recv: B:60.54 @:0
Recv: B:60.54 @:0
Recv: B:60.54 @:0
Recv: B:60.48 @:0
Recv: B:60.38 @:0
Recv: B:60.16 @:0
Recv: B:60.16 @:0
Recv: B:60.06 @:0
Recv: bias: 56 d: 56 min: 59.47 max: 60.63
Recv: Ku: 122.92 Tu: 47.73
Recv: Classic PID
Recv: Kp: 73.75
Recv: Ki: 3.09
Recv: Kd: 439.98
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Send: M500
Recv: T:23.8 /0.0 B:60.0 /60.0 T0:23.8 /0.0 @:0 B@:56 P:26.1 A:39.3
Recv: echo:Settings Stored
Recv: ok
Send: M303 E0 C5 S215
Recv: PID Autotune start
Recv: T:23.72 @:127
Recv: T:25.75 @:127
Recv: T:30.73 @:127
Recv: T:35.50 @:127
Recv: T:42.00 @:127
Recv: T:47.61 @:127
Recv: T:54.00 @:127
Recv: T:60.67 @:127
Recv: T:66.07 @:127
Recv: T:72.39 @:127
Recv: T:78.54 @:127
Recv: T:83.82 @:127
Recv: T:89.70 @:127
Recv: T:95.42 @:127
Recv: T:100.31 @:127
Recv: T:105.98 @:127
Recv: T:110.74 @:127
Recv: T:116.10 @:127
Recv: T:121.33 @:127
Recv: T:125.89 @:127
Recv: T:130.88 @:127
Recv: T:135.94 @:127
Recv: T:139.99 @:127
Recv: T:145.13 @:127
Recv: T:149.73 @:127
Recv: T:153.96 @:127
Recv: T:158.41 @:127
Recv: T:162.43 @:127
Recv: T:166.76 @:127
Recv: T:171.00 @:127
Recv: T:174.81 @:127
Recv: T:178.96 @:127
Recv: T:183.21 @:127
Recv: T:186.82 @:127
Recv: T:190.63 @:127
Recv: T:194.51 @:127
Recv: T:197.60 @:127
Recv: T:201.61 @:127
Recv: T:205.00 @:127
Recv: T:208.66 @:127
Recv: T:212.60 @:127
Recv: T:215.89 @:0
Recv: T:218.59 @:0
Recv: T:220.50 @:0
Recv: T:219.90 @:0
Recv: T:218.28 @:0
Recv: T:216.51 @:0
Recv: T:213.96 @:127
Recv: T:211.35 @:127
Recv: T:210.89 @:127
Recv: T:212.34 @:127
Recv: T:214.84 @:127
Recv: T:217.34 @:0
Recv: T:219.17 @:0
Recv: T:219.22 @:0
Recv: T:218.07 @:0
Recv: T:216.51 @:0
Recv: bias: 116 d: 116 min: 210.89 max: 219.53
Recv: T:213.96 @:116
Recv: T:211.46 @:116
Recv: T:210.73 @:116
Recv: T:211.41 @:116
Recv: T:213.80 @:116
Recv: T:215.94 @:0
Recv: T:217.97 @:0
Recv: T:218.39 @:0
Recv: T:217.76 @:0
Recv: T:215.78 @:0
Recv: bias: 116 d: 116 min: 210.73 max: 218.65
Recv: T:213.49 @:116
Recv: T:211.72 @:116
Recv: T:211.51 @:116
Recv: T:212.81 @:116
Recv: T:214.74 @:116
Recv: T:217.03 @:0
Recv: T:218.70 @:0
Recv: T:218.65 @:0
Recv: T:217.45 @:0
Recv: T:215.31 @:0
Recv: bias: 113 d: 113 min: 211.15 max: 218.91
Recv: Ku: 37.08 Tu: 19.92
Recv: Classic PID
Recv: Kp: 22.25
Recv: Ki: 2.23
Recv: Kd: 55.41
Recv: T:213.33 @:113
Recv: T:211.35 @:113
Recv: T:211.04 @:113
Recv: T:212.34 @:113
Recv: T:214.38 @:113
Recv: T:216.61 @:0
Recv: T:218.49 @:0
Recv: T:218.85 @:0
Recv: T:218.02 @:0
Recv: T:215.89 @:0
Recv: bias: 114 d: 114 min: 210.94 max: 218.85
Recv: Ku: 36.67 Tu: 20.20
Recv: Classic PID
Recv: Kp: 22.00
Recv: Ki: 2.18
Recv: Kd: 55.54
Recv: T:213.59 @:114
Recv: T:211.51 @:114
Recv: T:211.09 @:114
Recv: T:212.19 @:114
Recv: T:214.53 @:114
Recv: T:216.93 @:0
Recv: T:218.65 @:0
Recv: T:218.96 @:0
Recv: T:218.02 @:0
Recv: T:216.46 @:0
Recv: bias: 113 d: 113 min: 210.99 max: 219.06
Recv: Ku: 35.64 Tu: 20.74
Recv: Classic PID
Recv: Kp: 21.39
Recv: Ki: 2.06
Recv: Kd: 55.44
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Recv: T:214.5 /215.0 B:45.9 /0.0 T0:214.5 /215.0 @:113 B@:0 P:26.4 A:37.7
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M106 S0
Recv: ok
Send: M301 E0 P73.75 I3.09 D439.98
Recv: ok p:73.75 i:3.09 d:439.98 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Send: M301 E-1 P73.75 I3.09 D439.98
Recv: ok p:73.75 i:3.09 d:439.98 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M140 S0
Recv: ok
Send: M301 E0 P21.39 I2.06 D55.44
Recv: ok p:21.39 i:2.06 d:55.44 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Send: M301 E-1 P21.39 I2.06 D55.44
Recv: ok p:21.39 i:2.06 d:55.44 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M140 S0
Recv: ok
Recv: T:211.9 /0.0 B:45.5 /0.0 T0:211.9 /0.0 @:0 B@:0 P:26.3 A:37.6
Recv: T:209.6 /0.0 B:45.5 /0.0 T0:209.6 /0.0 @:0 B@:0 P:26.4 A:37.7
Recv: T:208.0 /0.0 B:45.4 /0.0 T0:208.0 /0.0 @:0 B@:0 P:26.4 A:37.4
Recv: T:206.3 /0.0 B:45.3 /0.0 T0:206.3 /0.0 @:0 B@:0 P:26.3 A:37.6
Recv: T:204.3 /0.0 B:45.1 /0.0 T0:204.3 /0.0 @:0 B@:0 P:26.5 A:37.3
Recv: T:202.6 /0.0 B:45.0 /0.0 T0:202.6 /0.0 @:0 B@:0 P:26.4 A:37.3
Recv: T:200.7 /0.0 B:44.9 /0.0 T0:200.7 /0.0 @:0 B@:0 P:26.4 A:37.3
Recv: T:199.2 /0.0 B:44.7 /0.0 T0:199.2 /0.0 @:0 B@:0 P:26.4 A:37.4
Recv: T:197.8 /0.0 B:44.8 /0.0 T0:197.8 /0.0 @:0 B@:0 P:26.4 A:37.4
Recv: T:196.4 /0.0 B:44.5 /0.0 T0:196.4 /0.0 @:0 B@:0 P:26.4 A:37.4

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

This one seems wrong...

Send: M301 E0 P73.75 I3.09 D439.98

@iFrostizz
Copy link
Owner

I see... The PID applying command should be sent just after that the PID is finished.
Here, the buffer is full and the command is queued.

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

I'll wait for another version to try, but this is still a problem I guess. Don't rush, make sure it works at your place first ;-)

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Some last info:

M503 reports the stored settings (after combined bed/extruder pid calibration)

image

Alltrhough they seem ok-ish, the "bed" figures appear nowhere... And in between some extruder 0 settings occur that are wiped out by the last extruder PID.

image

image

@iFrostizz
Copy link
Owner

So I think that I will just let the user do one PID at a time by disabling the other textbox, that will make it more "bug-proof"

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Not really, since when I did them one after the other, I STILL got the extruder PID values written to the bed (or vice versa)

@iFrostizz
Copy link
Owner

Did you tried the version sending an M304 for the bed ?

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Did you update the version number so I can check? It is 1.02, but I believe they all are... Not easy to know what is what

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Reinstalled and restarted octoprint: new test.

@iFrostizz
Copy link
Owner

I didn't implemented the greying out input box yet, I will do it tomorrow

@ruedli
Copy link
Author

ruedli commented Sep 1, 2021

Retested, same problems.

image

image

Recv: B:60.14 @:0
Recv: B:60.11 @:0
Recv: bias: 57 d: 57 min: 59.38 max: 60.56
Recv: B:59.91 @:57
Recv: B:59.78 @:57
Recv: B:59.67 @:57
Recv: B:59.64 @:57
Recv: B:59.50 @:57
Recv: B:59.50 @:57
Recv: B:59.47 @:57
Recv: B:59.56 @:57
Recv: B:59.59 @:57
Recv: B:59.70 @:57
Recv: B:59.83 @:57
Recv: B:60.00 @:57
Recv: B:60.08 @:0
Recv: B:60.20 @:0
Recv: B:60.41 @:0
Recv: B:60.51 @:0
Recv: B:60.54 @:0
Recv: B:60.64 @:0
Recv: B:60.53 @:0
Recv: B:60.51 @:0
Recv: B:60.45 @:0
Recv: B:60.30 @:0
Recv: B:60.22 @:0
Recv: B:60.09 @:0
Recv: bias: 57 d: 57 min: 59.47 max: 60.64
Recv: Ku: 123.59 Tu: 46.69
Recv: Classic PID
Recv: Kp: 74.15
Recv: Ki: 3.18
Recv: Kd: 432.77
Recv: B:59.98 @:57
Recv: B:59.80 @:57
Recv: B:59.69 @:57
Recv: B:59.61 @:57
Recv: B:59.59 @:57
Recv: B:59.58 @:57
Recv: B:59.58 @:57
Recv: B:59.70 @:57
Recv: B:59.83 @:57
Recv: B:59.92 @:57
Recv: B:60.06 @:0
Recv: B:60.14 @:0
Recv: B:60.23 @:0
Recv: B:60.42 @:0
Recv: B:60.50 @:0
Recv: B:60.50 @:0
Recv: B:60.45 @:0
Recv: B:60.45 @:0
Recv: B:60.39 @:0
Recv: B:60.25 @:0
Recv: B:60.16 @:0
Recv: B:60.09 @:0
Recv: bias: 54 d: 54 min: 59.55 max: 60.57
Recv: Ku: 134.19 Tu: 45.11
Recv: Classic PID
Recv: Kp: 80.51
Recv: Ki: 3.57
Recv: Kd: 453.96
Recv: B:59.98 @:54
Recv: B:59.81 @:54
Recv: B:59.64 @:54
Recv: B:59.55 @:54
Recv: B:59.53 @:54
Recv: B:59.47 @:54
Recv: B:59.47 @:54
Recv: B:59.50 @:54
Recv: B:59.59 @:54
Recv: B:59.67 @:54
Recv: B:59.77 @:54
Recv: B:59.88 @:54
Recv: B:59.95 @:54
Recv: B:60.11 @:0
Recv: B:60.23 @:0
Recv: B:60.36 @:0
Recv: B:60.45 @:0
Recv: B:60.50 @:0
Recv: B:60.53 @:0
Recv: B:60.50 @:0
Recv: B:60.34 @:0
Recv: B:60.31 @:0
Recv: B:60.14 @:0
Recv: B:60.05 @:0
Recv: bias: 57 d: 57 min: 59.42 max: 60.56
Recv: Ku: 127.84 Tu: 47.23
Recv: Classic PID
Recv: Kp: 76.70
Recv: Ki: 3.25
Recv: Kd: 452.85
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Recv: T:61.0 /0.0 B:60.0 /60.0 T0:61.0 /0.0 @:0 B@:57 P:26.3 A:40.3
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M106 S255
Recv: ok
Send: M117 OP: OctoPlugout 3.1
Recv: LCD status changed
Recv: ok
Send: M304 P20.15 I2.00 D50.86
Recv: ok p:20.15 i:2.00 d:50.86
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M140 S0
Recv: ok
Send: M301 E0 P20.15 I2.00 D50.86
Recv: ok p:20.15 i:2.00 d:50.86 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Send: M304 P76.70 I3.25 D452.85
Recv: ok p:76.70 i:3.25 d:452.85
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M140 S0
Recv: ok
Send: M301 E0 P76.70 I3.25 D452.85
Recv: ok p:76.70 i:3.25 d:452.85 c:1.00
Recv: ok
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M104 S0
Recv: ok
Recv: T:60.7 /0.0 B:59.9 /0.0 T0:60.7 /0.0 @:0 B@:0 P:26.4 A:40.2
Recv: T:60.3 /0.0 B:59.7 /0.0 T0:60.3 /0.0 @:0 B@:0 P:26.4 A:40.2
Recv: T:59.8 /0.0 B:59.6 /0.0 T0:59.8 /0.0 @:0 B@:0 P:26.4 A:40.0
Recv: T:59.3 /0.0 B:59.4 /0.0 T0:59.3 /0.0 @:0 B@:0 P:26.4 A:40.1
Recv: T:58.7 /0.0 B:59.3 /0.0 T0:58.7 /0.0 @:0 B@:0 P:26.4 A:40.0
Recv: T:58.1 /0.0 B:59.2 /0.0 T0:58.1 /0.0 @:0 B@:0 P:26.4 A:39.9

@iFrostizz
Copy link
Owner

Yes, you ran the PID for both bed and hotend at the same time, right?
I meant when you do it separately. I will just modify the UI to prevent the user from entering both values at the same time.

@ruedli
Copy link
Author

ruedli commented Sep 2, 2021

Well, change it, test it and when it works for you, publish it and I will then test it as well. Note that it could be an issue that is shown only when there are two windows open. I have that and both show different messages, so there is a difference in behavior that should not happen and could result in problems for other users with different configurations and different timing.

@iFrostizz
Copy link
Owner

iFrostizz commented Sep 2, 2021

I just pushed the new version, with the disabled input to prevent the user from typing in the two boxes at the same time.
image
first instance
image
second instance
And it looks like I got the same results from the two octoprint instances.
Sadly, I cannot try the bed pid because it is not enabled in my firmware, and again I don't have Marlin 1.x.x

@ruedli
Copy link
Author

ruedli commented Sep 2, 2021

OK, I will have a go, doing extruder and the bed PID calibration with this.

@ruedli
Copy link
Author

ruedli commented Sep 2, 2021

As I feared it is not OK, the bed PID settings are saved into the extruder PID as well. I feel it is the multi window octoprint that ruins it, which make me worried that you are doing things in the client that should be done in the server context and you rely on client context for doing executing things. On marlin 2.0.x, is it an option to enable PID bed tuning in your Marlin config and test with that firmware? Unfortunately I cannot run Marlin 2.x as I rely on my MMU2 working flawlessly.

These are the screenprints I get:

image

and in the other window:

image

Detailed logs:

===========================================
First M503 output OK:
Recv: echo:PID settings:
Recv: echo: M301 P19.65 I1.90 D50.88

Second M503 output Not OK, ruins the extruder:
Recv: echo:PID settings:
Recv: echo: M301 P76.21 I3.19 D454.68
Recv: echo:PID heatbed settings:
Recv: echo: M304 P76.21 I3.19 D454.68

Detailed logs:

Recv: T:21.4 /0.0 B:21.2 /0.0 T0:21.4 /0.0 @:0 B@:0 P:22.2 A:24.5
Recv: T:21.3 /0.0 B:21.0 /0.0 T0:21.3 /0.0 @:0 B@:0 P:22.3 A:24.9
Recv: T:21.2 /0.0 B:21.3 /0.0 T0:21.2 /0.0 @:0 B@:0 P:22.4 A:25.2
Recv: T:21.3 /0.0 B:21.1 /0.0 T0:21.3 /0.0 @:0 B@:0 P:22.3 A:25.2
Recv: T:21.2 /0.0 B:21.0 /0.0 T0:21.2 /0.0 @:0 B@:0 P:22.4 A:24.5
Recv: T:21.3 /0.0 B:21.1 /0.0 T0:21.3 /0.0 @:0 B@:0 P:22.3 A:25.0
Recv: T:21.2 /0.0 B:21.1 /0.0 T0:21.2 /0.0 @:0 B@:0 P:22.4 A:25.0
Send: M303 E0 C5 S215
Recv: PID Autotune start
Recv: T:21.44 @:127
Recv: T:23.37 @:127
Recv: T:28.28 @:127
Recv: T:34.12 @:127
Recv: T:40.25 @:127
Recv: T:46.67 @:127
Recv: T:52.63 @:127
Recv: T:59.58 @:127
Recv: T:66.05 @:127
Recv: T:71.98 @:127
Recv: T:78.47 @:127
Recv: T:84.82 @:127
Recv: T:90.29 @:127
Recv: T:96.35 @:127
Recv: T:102.32 @:127
Recv: T:107.24 @:127
Recv: T:112.14 @:127
Recv: T:116.59 @:127
Recv: T:122.52 @:127
Recv: T:128.45 @:127
Recv: T:133.30 @:127
Recv: T:139.14 @:127
Recv: T:145.18 @:127
Recv: T:149.92 @:127
Recv: T:155.63 @:127
Recv: T:160.48 @:127
Recv: T:166.29 @:127
Recv: T:171.64 @:127
Recv: T:176.41 @:127
Recv: T:181.59 @:127
Recv: T:186.85 @:127
Recv: T:191.12 @:127
Recv: T:195.99 @:127
Recv: T:200.63 @:127
Recv: T:205.40 @:127
Recv: T:210.05 @:127
Recv: T:214.64 @:127
Recv: T:219.11 @:0
Recv: T:222.44 @:0
Recv: T:223.63 @:0
Recv: T:223.19 @:0
Recv: T:222.19 @:0
Recv: T:221.13 @:0
Recv: T:219.43 @:0
Recv: T:217.66 @:0
Recv: T:216.35 @:0
Recv: T:214.38 @:127
Recv: T:213.13 @:127
Recv: T:213.49 @:127
Recv: T:215.47 @:0
Recv: T:218.33 @:0
Recv: T:220.38 @:0
Recv: T:221.44 @:0
Recv: T:220.81 @:0
Recv: T:219.69 @:0
Recv: T:218.23 @:0
Recv: T:216.93 @:0
Recv: T:215.42 @:0
Recv: bias: 70 d: 70 min: 212.97 max: 221.44
Recv: T:213.75 @:70
Recv: T:212.40 @:70
Recv: T:212.50 @:70
Recv: T:213.33 @:70
Recv: T:214.69 @:70
Recv: T:216.46 @:0
Recv: T:217.08 @:0
Recv: T:217.14 @:0
Recv: T:216.51 @:0
Recv: T:215.47 @:0
Recv: bias: 70 d: 70 min: 212.03 max: 217.34
Recv: T:213.75 @:70
Recv: T:212.81 @:70
Recv: T:212.60 @:70
Recv: T:213.70 @:70
Recv: T:214.84 @:70
Recv: T:216.46 @:0
Recv: T:217.60 @:0
Recv: T:217.97 @:0
Recv: T:217.08 @:0
Recv: T:215.68 @:0
Recv: bias: 67 d: 67 min: 212.40 max: 217.97
Recv: Ku: 30.61 Tu: 20.98
Recv: Classic PID
Recv: Kp: 18.37
Recv: Ki: 1.75
Recv: Kd: 48.17
Recv: T:214.64 @:67
Recv: T:213.02 @:67
Recv: T:212.14 @:67
Recv: T:212.66 @:67
Recv: T:213.75 @:67
Recv: T:215.00 @:67
Recv: T:216.46 @:0
Recv: T:217.34 @:0
Recv: T:217.19 @:0
Recv: T:216.20 @:0
Recv: T:215.21 @:0
Recv: bias: 67 d: 67 min: 212.14 max: 217.34
Recv: Ku: 32.76 Tu: 20.72
Recv: Classic PID
Recv: Kp: 19.65
Recv: Ki: 1.90
Recv: Kd: 50.90
Recv: T:213.70 @:67
Recv: T:212.55 @:67
Recv: T:212.50 @:67
Recv: T:213.49 @:67
Recv: T:214.84 @:67
Recv: T:216.20 @:0
Recv: T:217.24 @:0
Recv: T:217.40 @:0
Recv: T:217.03 @:0
Recv: T:215.78 @:0
Recv: bias: 67 d: 67 min: 212.40 max: 217.60
Recv: Ku: 32.76 Tu: 20.71
Recv: Classic PID
Recv: Kp: 19.65
Recv: Ki: 1.90
Recv: Kd: 50.88
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Recv: T:214.8 /215.0 B:21.3 /0.0 T0:214.8 /215.0 @:67 B@:0 P:24.6 A:27.6
Send: M500
Recv: echo:Settings Stored
Recv: ok
Send: M106 S0
Recv: ok
Send: M104 S0
Recv: ok
Recv: T:213.7 /0.0 B:21.1 /0.0 T0:213.7 /0.0 @:0 B@:0 P:24.5 A:27.7
Recv: T:211.9 /0.0 B:21.2 /0.0 T0:211.9 /0.0 @:0 B@:0 P:24.6 A:27.6

=================================================================================
Second run:

Recv: T:80.8 /0.0 B:21.4 /0.0 T0:80.8 /0.0 @:0 B@:0 P:23.9 A:29.5
Recv: T:80.3 /0.0 B:21.3 /0.0 T0:80.3 /0.0 @:0 B@:0 P:23.9 A:29.3
Recv: T:79.9 /0.0 B:21.6 /0.0 T0:79.9 /0.0 @:0 B@:0 P:23.9 A:29.5
Recv: T:79.4 /0.0 B:21.5 /0.0 T0:79.4 /0.0 @:0 B@:0 P:23.9 A:29.5
Recv: T:78.9 /0.0 B:21.5 /0.0 T0:78.9 /0.0 @:0 B@:0 P:23.9 A:29.4
Recv: T:78.4 /0.0 B:21.4 /0.0 T0:78.4 /0.0 @:0 B@:0 P:23.8 A:29.3
Recv: T:78.0 /0.0 B:21.5 /0.0 T0:78.0 /0.0 @:0 B@:0 P:23.9 A:29.3
Recv: T:77.5 /0.0 B:21.4 /0.0 T0:77.5 /0.0 @:0 B@:0 P:23.8 A:29.3
Recv: T:77.0 /0.0 B:21.5 /0.0 T0:77.0 /0.0 @:0 B@:0 P:23.9 A:29.3
Recv: T:76.6 /0.0 B:21.3 /0.0 T0:76.6 /0.0 @:0 B@:0 P:23.8 A:29.6
Recv: T:76.1 /0.0 B:21.6 /0.0 T0:76.1 /0.0 @:0 B@:0 P:23.9 A:29.6
Recv: T:75.7 /0.0 B:21.5 /0.0 T0:75.7 /0.0 @:0 B@:0 P:23.8 A:29.5
Recv: T:75.3 /0.0 B:21.5 /0.0 T0:75.3 /0.0 @:0 B@:0 P:23.8 A:29.9
Recv: T:74.8 /0.0 B:21.4 /0.0 T0:74.8 /0.0 @:0 B@:0 P:23.8 A:29.5
Recv: T:74.4 /0.0 B:21.5 /0.0 T0:74.4 /0.0 @:0 B@:0 P:23.8 A:29.4
Recv: T:74.0 /0.0 B:21.5 /0.0 T0:74.0 /0.0 @:0 B@:0 P:23.7 A:29.6
Recv: T:73.6 /0.0 B:21.5 /0.0 T0:73.6 /0.0 @:0 B@:0 P:23.8 A:29.6
Recv: T:73.1 /0.0 B:21.6 /0.0 T0:73.1 /0.0 @:0 B@:0 P:23.7 A:29.6
Recv: T:72.7 /0.0 B:21.4 /0.0 T0:72.7 /0.0 @:0 B@:0 P:23.7 A:29.6
Recv: T:72.3 /0.0 B:21.4 /0.0 T0:72.3 /0.0 @:0 B@:0 P:23.7 A:29.8
Recv: T:71.9 /0.0 B:21.5 /0.0 T0:71.9 /0.0 @:0 B@:0 P:23.7 A:29.5
Send: M303 E-1 C5 S60
Recv: PID Autotune start
Recv: B:21.48 @:127
Recv: B:21.41 @:127
Recv: B:21.37 @:127
Recv: B:21.72 @:127
Recv: B:22.11 @:127
Recv: B:22.38 @:127
Recv: B:22.81 @:127
Recv: B:23.55 @:127
Recv: B:24.30 @:127
Recv: B:24.92 @:127
Recv: B:25.48 @:127
Recv: B:26.19 @:127
Recv: B:26.76 @:127
Recv: B:27.44 @:127
Recv: B:28.01 @:127
Recv: B:28.89 @:127
Recv: B:29.43 @:127
Recv: B:30.08 @:127
Recv: B:30.76 @:127
Recv: B:31.64 @:127
Recv: B:32.19 @:127
Recv: B:32.92 @:127
Recv: B:33.59 @:127
Recv: B:34.27 @:127
Recv: B:35.15 @:127
Recv: B:35.77 @:127
Recv: B:36.31 @:127
Recv: B:36.92 @:127
Recv: B:37.48 @:127
Recv: B:38.17 @:127
Recv: B:38.88 @:127
Recv: B:39.50 @:127
Recv: B:40.08 @:127
Recv: B:40.94 @:127
Recv: B:41.85 @:127
Recv: B:42.78 @:127
Recv: B:43.61 @:127
Recv: B:44.52 @:127
Recv: B:45.54 @:127
Recv: B:46.26 @:127
Recv: B:47.25 @:127
Recv: B:48.09 @:127
Recv: B:48.93 @:127
Recv: B:49.77 @:127
Recv: B:50.58 @:127
Recv: B:51.47 @:127
Recv: B:52.36 @:127
Recv: B:53.15 @:127
Recv: B:54.01 @:127
Recv: B:54.88 @:127
Recv: B:55.52 @:127
Recv: B:56.14 @:127
Recv: B:56.59 @:127
Recv: B:57.17 @:127
Recv: B:57.67 @:127
Recv: B:58.16 @:127
Recv: B:58.78 @:127
Recv: B:59.42 @:127
Recv: B:59.91 @:127
Recv: B:60.60 @:0
Recv: B:61.02 @:0
Recv: B:61.52 @:0
Recv: B:61.93 @:0
Recv: B:62.16 @:0
Recv: B:62.42 @:0
Recv: B:62.55 @:0
Recv: B:62.52 @:0
Recv: B:62.63 @:0
Recv: B:62.58 @:0
Recv: B:62.48 @:0
Recv: B:62.48 @:0
Recv: B:62.32 @:0
Recv: B:62.23 @:0
Recv: B:62.16 @:0
Recv: B:61.96 @:0
Recv: B:61.90 @:0
Recv: B:61.70 @:0
Recv: B:61.60 @:0
Recv: B:61.42 @:0
Recv: B:61.23 @:0
Recv: B:61.19 @:0
Recv: B:61.03 @:0
Recv: B:60.82 @:0
Recv: B:60.69 @:0
Recv: B:60.51 @:0
Recv: B:60.39 @:0
Recv: B:60.31 @:0
Recv: B:60.08 @:0
Recv: B:59.95 @:127
Recv: B:59.77 @:127
Recv: B:59.61 @:127
Recv: B:59.59 @:127
Recv: B:59.63 @:127
Recv: B:59.77 @:127
Recv: B:60.02 @:0
Recv: B:60.36 @:0
Recv: B:60.66 @:0
Recv: B:60.97 @:0
Recv: B:61.23 @:0
Recv: B:61.39 @:0
Recv: B:61.55 @:0
Recv: B:61.60 @:0
Recv: B:61.60 @:0
Recv: B:61.57 @:0
Recv: B:61.47 @:0
Recv: B:61.45 @:0
Recv: B:61.35 @:0
Recv: B:61.27 @:0
Recv: B:61.09 @:0
Recv: B:61.02 @:0
Recv: B:60.87 @:0
Recv: B:60.71 @:0
Recv: B:60.56 @:0
Recv: B:60.42 @:0
Recv: B:60.30 @:0
Recv: B:60.19 @:0
Recv: bias: 58 d: 58 min: 59.55 max: 61.63
Recv: B:59.98 @:58
Recv: B:59.81 @:58
Recv: B:59.64 @:58
Recv: B:59.50 @:58
Recv: B:59.47 @:58
Recv: B:59.42 @:58
Recv: B:59.42 @:58
Recv: B:59.47 @:58
Recv: B:59.50 @:58
Recv: B:59.59 @:58
Recv: B:59.69 @:58
Recv: B:59.86 @:58
Recv: B:59.94 @:58
Recv: B:60.16 @:0
Recv: B:60.31 @:0
Recv: B:60.38 @:0
Recv: B:60.45 @:0
Recv: B:60.50 @:0
Recv: B:60.48 @:0
Recv: B:60.50 @:0
Recv: B:60.42 @:0
Recv: B:60.41 @:0
Recv: B:60.28 @:0
Recv: B:60.19 @:0
Recv: B:60.05 @:0
Recv: bias: 58 d: 58 min: 59.34 max: 60.56
Recv: B:59.91 @:58
Recv: B:59.75 @:58
Recv: B:59.61 @:58
Recv: B:59.52 @:58
Recv: B:59.47 @:58
Recv: B:59.45 @:58
Recv: B:59.52 @:58
Recv: B:59.58 @:58
Recv: B:59.67 @:58
Recv: B:59.72 @:58
Recv: B:59.88 @:58
Recv: B:60.02 @:0
Recv: B:60.16 @:0
Recv: B:60.31 @:0
Recv: B:60.41 @:0
Recv: B:60.47 @:0
Recv: B:60.45 @:0
Recv: B:60.54 @:0
Recv: B:60.47 @:0
Recv: B:60.36 @:0
Recv: B:60.30 @:0
Recv: B:60.19 @:0
Recv: B:60.06 @:0
Recv: bias: 58 d: 58 min: 59.39 max: 60.54
Recv: Ku: 128.17 Tu: 45.63
Recv: Classic PID
Recv: Kp: 76.90
Recv: Ki: 3.37
Recv: Kd: 438.63
Recv: B:59.83 @:58
Recv: B:59.75 @:58
Recv: B:59.67 @:58
Recv: B:59.52 @:58
Recv: B:59.48 @:58
Recv: B:59.53 @:58
Recv: B:59.52 @:58
Recv: B:59.64 @:58
Recv: B:59.69 @:58
Recv: B:59.81 @:58
Recv: B:59.95 @:58
Recv: B:60.06 @:0
Recv: B:60.16 @:0
Recv: B:60.42 @:0
Recv: B:60.42 @:0
Recv: B:60.45 @:0
Recv: B:60.50 @:0
Recv: B:60.53 @:0
Recv: B:60.53 @:0
Recv: B:60.50 @:0
Recv: B:60.34 @:0
Recv: B:60.19 @:0
Recv: B:60.11 @:0
Recv: bias: 58 d: 58 min: 59.47 max: 60.56
Recv: Ku: 135.68 Tu: 47.46
Recv: Classic PID
Recv: Kp: 81.41
Recv: Ki: 3.43
Recv: Kd: 483.00
Recv: B:59.97 @:58
Recv: B:59.84 @:58
Recv: B:59.64 @:58
Recv: B:59.59 @:58
Recv: B:59.52 @:58
Recv: B:59.50 @:58
Recv: B:59.44 @:58
Recv: B:59.52 @:58
Recv: B:59.61 @:58
Recv: B:59.67 @:58
Recv: B:59.80 @:58
Recv: B:59.95 @:58
Recv: B:60.05 @:0
Recv: B:60.22 @:0
Recv: B:60.41 @:0
Recv: B:60.42 @:0
Recv: B:60.51 @:0
Recv: B:60.53 @:0
Recv: B:60.51 @:0
Recv: B:60.51 @:0
Recv: B:60.39 @:0
Recv: B:60.33 @:0
Recv: B:60.16 @:0
Recv: B:60.08 @:0
Recv: bias: 58 d: 58 min: 59.44 max: 60.60
Recv: Ku: 127.02 Tu: 47.73
Recv: Classic PID
Recv: Kp: 76.21
Recv: Ki: 3.19
Recv: Kd: 454.68
Recv: PID Autotune finished! Put the last Kp, Ki and Kd constants from above into Configuration.h
Recv: ok
Send: M500
Recv: T:36.7 /0.0 B:60.0 /60.0 T0:36.7 /0.0 @:0 B@:58 P:27.3 A:38.3
Recv: echo:Settings Stored
Recv: ok
Send: M140 S0
Recv: ok
Recv: T:36.6 /0.0 B:59.9 /0.0 T0:36.6 /0.0 @:0 B@:0 P:27.4 A:38.3
Recv: T:36.5 /0.0 B:59.6 /0.0 T0:36.5 /0.0 @:0 B@:0 P:27.4 A:38.3
Recv: T:36.5 /0.0 B:59.5 /0.0 T0:36.5 /0.0 @:0 B@:0 P:27.4 A:38.1
Recv: T:36.4 /0.0 B:59.4 /0.0 T0:36.4 /0.0 @:0 B@:0 P:27.4 A:38.1
Recv: T:36.2 /0.0 B:59.2 /0.0 T0:36.2 /0.0 @:0 B@:0 P:27.4 A:38.0
Recv: T:36.2 /0.0 B:59.1 /0.0 T0:36.2 /0.0 @:0 B@:0 P:27.4 A:38.2
Recv: T:36.2 /0.0 B:59.0 /0.0 T0:36.2 /0.0 @:0 B@:0 P:27.5 A:38.0
Recv: T:36.2 /0.0 B:58.9 /0.0 T0:36.2 /0.0 @:0 B@:0 P:27.5 A:38.1
Recv: T:36.1 /0.0 B:58.7 /0.0 T0:36.1 /0.0 @:0 B@:0 P:27.6 A:37.6

@ruedli
Copy link
Author

ruedli commented Sep 2, 2021

The key to the solution could be that you ONLY execute pop-ups and M301 / M304 settings for the window where the PID tuning is executed from. Then I feel it should work, as that window picks up the right extruder... The good news is that you can test that functionality as well without capability to run bed PID tuning.

Is there a way in your script that does the popup and M301/M304 to be aware of the client context and whether autoleveling is running?

@ruedli
Copy link
Author

ruedli commented Sep 2, 2021

And.... with that client / calibration PID tuning awareness you can execute both in one run again, no need to make them mutually exclusive.....

@iFrostizz
Copy link
Owner

Hey @ruedli .
I just enabled the bed PID tuning on my printer, ran a PID from the plugin, and opened several windows.
I got the same issue as you and finally figured out why that would happen, I was confused!
So now, the notification should not spawn anymore nor the wrong settings be applied on a window that didn't started a PID tuning. I think that I will also grey out the button that runs the tuning for all sessions once it has been clicked and until a PID was finished because that would induce the same bug if pressed from another session. I will do as well for the progress bar (show the same percentage for every sessions)

@ruedli
Copy link
Author

ruedli commented Sep 6, 2021

@iFrostizz That is good to hear . Now that you can reproduce it, I am sure you can get it fixed. The multiple window was probably something not considered in the original design and was causing errors and confusion. Maybe in more places? Best to close this issue when you release a version with fixes it and document the version in which this is fixed.

@skl111
Copy link

skl111 commented Dec 21, 2021

Anyone know the status of this issue?

@ruedli
Copy link
Author

ruedli commented Dec 21, 2021

@skl111 I have tested versions from the devel branch and many problems were resolved. It also helped not having multiple octoprint windows open. I left it to @iFrostizz to close this issue when the code was merged to main.

@iFrostizz
Copy link
Owner

Hey @skl111 and @ruedli , sorry for the lack of news but I'm quite busy currently. For now I'd suggest to use the devel branch and I'll add more features to it and PR to main when this one will be satisfying. Thanks for helping ruedli!

@skl111
Copy link

skl111 commented Dec 21, 2021

Will give it a go, thanks!

@skl111
Copy link

skl111 commented Feb 11, 2022

I tried the devel branch and it will let you input the values, but after you do that and hit "Run PID Autotune" it does nothing, nothing gets sent to the printer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants