Bed temp auto tune not saving results?

I am doing this …

>>> M303 E1 S80
SENDING:M303 E1 S80
Target:  80.0
Start PID tune for index E1, designator: B
B: Starting PID Autotune, 8 max cycles, M304 aborts
// Autopid Status -  59.0/ 80.0 @255 0/8
// Autopid Status -  59.1/ 80.0 @255 0/8
// Autopid Status -  59.5/ 80.0 @255 0/8
// Autopid Status -  59.9/ 80.0 @255 0/8
// Autopid Status -  60.4/ 80.0 @255 0/8
// Autopid Status -  60.9/ 80.0 @255 0/8
// Autopid Status -  61.3/ 80.0 @255 0/8
// Autopid Status -  61.7/ 80.0 @255 0/8
// Autopid Status -  62.1/ 80.0 @255 0/8
// Autopid Status -  62.5/ 80.0 @255 0/8
// Autopid Status -  62.9/ 80.0 @255 0/8
// Autopid Status -  63.2/ 80.0 @255 0/8
// Autopid Status -  63.5/ 80.0 @255 0/8
// Autopid Status -  63.8/ 80.0 @255 0/8
// Autopid Status -  64.0/ 80.0 @255 0/8
// Autopid Status -  64.3/ 80.0 @255 0/8
// Autopid Status -  64.5/ 80.0 @255 0/8
// Autopid Status -  64.8/ 80.0 @255 0/8
// Autopid Status -  65.0/ 80.0 @255 0/8
// Autopid Status -  65.2/ 80.0 @255 0/8
// Autopid Status -  65.4/ 80.0 @255 0/8
// Autopid Status -  65.6/ 80.0 @255 0/8
// Autopid Status -  65.8/ 80.0 @255 0/8
// Autopid Status -  65.9/ 80.0 @255 0/8
// Autopid Status -  66.1/ 80.0 @255 0/8
// Autopid Status -  66.3/ 80.0 @255 0/8
// Autopid Status -  66.4/ 80.0 @255 0/8
// Autopid Status -  66.6/ 80.0 @255 0/8
// Autopid Status -  66.8/ 80.0 @255 0/8
// Autopid Status -  66.9/ 80.0 @255 0/8
// Autopid Status -  67.1/ 80.0 @255 0/8
// Autopid Status -  67.2/ 80.0 @255 0/8
// Autopid Status -  67.3/ 80.0 @255 0/8
// Autopid Status -  67.5/ 80.0 @255 0/8
// Autopid Status -  67.6/ 80.0 @255 0/8
// Autopid Status -  67.7/ 80.0 @255 0/8
// Autopid Status -  67.9/ 80.0 @255 0/8
// Autopid Status -  68.1/ 80.0 @255 0/8
// Autopid Status -  68.2/ 80.0 @255 0/8
// Autopid Status -  68.3/ 80.0 @255 0/8
// Autopid Status -  68.4/ 80.0 @255 0/8
// Autopid Status -  68.5/ 80.0 @255 0/8
// Autopid Status -  68.6/ 80.0 @255 0/8
// Autopid Status -  68.7/ 80.0 @255 0/8
// Autopid Status -  68.8/ 80.0 @255 0/8
// Autopid Status -  68.9/ 80.0 @255 0/8
// Autopid Status -  69.0/ 80.0 @255 0/8
// Autopid Status -  69.1/ 80.0 @255 0/8
// Autopid Status -  69.3/ 80.0 @255 0/8
// Autopid Status -  69.4/ 80.0 @255 0/8
// Autopid Status -  69.5/ 80.0 @255 0/8
// Autopid Status -  69.6/ 80.0 @255 0/8
// Autopid Status -  69.7/ 80.0 @255 0/8
// Autopid Status -  69.8/ 80.0 @255 0/8
// Autopid Status -  69.9/ 80.0 @255 0/8
// Autopid Status -  70.0/ 80.0 @255 0/8
// Autopid Status -  70.1/ 80.0 @255 0/8
// Autopid Status -  70.2/ 80.0 @255 0/8
// Autopid Status -  70.3/ 80.0 @255 0/8
// Autopid Status -  70.4/ 80.0 @255 0/8
// Autopid Status -  70.5/ 80.0 @255 0/8
// Autopid Status -  70.6/ 80.0 @255 0/8
// Autopid Status -  70.7/ 80.0 @255 0/8
// Autopid Status -  70.8/ 80.0 @255 0/8
// Autopid Status -  70.9/ 80.0 @255 0/8
// Autopid Status -  71.0/ 80.0 @255 0/8
// Autopid Status -  71.1/ 80.0 @255 0/8
// Autopid Status -  71.2/ 80.0 @255 0/8
// Autopid Status -  71.3/ 80.0 @255 0/8
// Autopid Status -  71.3/ 80.0 @255 0/8
// Autopid Status -  71.4/ 80.0 @255 0/8
// Autopid Status -  71.5/ 80.0 @255 0/8
// Autopid Status -  71.6/ 80.0 @255 0/8
// Autopid Status -  71.7/ 80.0 @255 0/8
// Autopid Status -  71.8/ 80.0 @255 0/8
// Autopid Status -  71.9/ 80.0 @255 0/8
// Autopid Status -  72.0/ 80.0 @255 0/8
// Autopid Status -  72.1/ 80.0 @255 0/8
// Autopid Status -  72.2/ 80.0 @255 0/8
// Autopid Status -  72.3/ 80.0 @255 0/8
// Autopid Status -  72.4/ 80.0 @255 0/8
// Autopid Status -  72.5/ 80.0 @255 0/8
// Autopid Status -  72.5/ 80.0 @255 0/8
// Autopid Status -  72.6/ 80.0 @255 0/8
// Autopid Status -  72.7/ 80.0 @255 0/8
// Autopid Status -  72.8/ 80.0 @255 0/8
// Autopid Status -  72.9/ 80.0 @255 0/8
// Autopid Status -  73.0/ 80.0 @255 0/8
// Autopid Status -  73.0/ 80.0 @255 0/8
// Autopid Status -  73.1/ 80.0 @255 0/8
// Autopid Status -  73.2/ 80.0 @255 0/8
// Autopid Status -  73.3/ 80.0 @255 0/8
// Autopid Status -  73.4/ 80.0 @255 0/8
// Autopid Status -  73.5/ 80.0 @255 0/8
// Autopid Status -  73.6/ 80.0 @255 0/8
// Autopid Status -  73.8/ 80.0 @255 0/8
// Autopid Status -  73.9/ 80.0 @255 0/8
// Autopid Status -  73.9/ 80.0 @255 0/8
// Autopid Status -  74.0/ 80.0 @255 0/8
// Autopid Status -  74.1/ 80.0 @255 0/8
// Autopid Status -  74.2/ 80.0 @255 0/8
// Autopid Status -  74.3/ 80.0 @255 0/8
// Autopid Status -  74.3/ 80.0 @255 0/8
// Autopid Status -  74.4/ 80.0 @255 0/8
// Autopid Status -  74.5/ 80.0 @255 0/8
// Autopid Status -  74.5/ 80.0 @255 0/8
// Autopid Status -  74.6/ 80.0 @255 0/8
// Autopid Status -  74.7/ 80.0 @255 0/8
// Autopid Status -  74.7/ 80.0 @255 0/8
// Autopid Status -  74.8/ 80.0 @255 0/8
// Autopid Status -  74.9/ 80.0 @255 0/8
// Autopid Status -  75.0/ 80.0 @255 0/8
// Autopid Status -  75.0/ 80.0 @255 0/8
// Autopid Status -  75.1/ 80.0 @255 0/8
// Autopid Status -  75.2/ 80.0 @255 0/8
// Autopid Status -  75.3/ 80.0 @255 0/8
// Autopid Status -  75.4/ 80.0 @255 0/8
// Autopid Status -  75.5/ 80.0 @255 0/8
// Autopid Status -  75.5/ 80.0 @255 0/8
// Autopid Status -  75.5/ 80.0 @255 0/8
// Autopid Status -  75.6/ 80.0 @255 0/8
// Autopid Status -  75.7/ 80.0 @255 0/8
// Autopid Status -  75.8/ 80.0 @255 0/8
// Autopid Status -  75.9/ 80.0 @255 0/8
// Autopid Status -  76.0/ 80.0 @255 0/8
// Autopid Status -  76.1/ 80.0 @255 0/8
// Autopid Status -  76.2/ 80.0 @255 0/8
// Autopid Status -  76.3/ 80.0 @255 0/8
// Autopid Status -  76.3/ 80.0 @255 0/8
// Autopid Status -  76.4/ 80.0 @255 0/8
// Autopid Status -  76.5/ 80.0 @255 0/8
// Autopid Status -  76.5/ 80.0 @255 0/8
// Autopid Status -  76.6/ 80.0 @255 0/8
// Autopid Status -  76.7/ 80.0 @255 0/8
// Autopid Status -  76.8/ 80.0 @255 0/8
// Autopid Status -  76.8/ 80.0 @255 0/8
// Autopid Status -  76.9/ 80.0 @255 0/8
// Autopid Status -  77.0/ 80.0 @255 0/8
// Autopid Status -  77.0/ 80.0 @255 0/8
// Autopid Status -  77.1/ 80.0 @255 0/8
// Autopid Status -  77.1/ 80.0 @255 0/8
// Autopid Status -  77.2/ 80.0 @255 0/8
// Autopid Status -  77.2/ 80.0 @255 0/8
// Autopid Status -  77.3/ 80.0 @255 0/8
// Autopid Status -  77.3/ 80.0 @255 0/8
// Autopid Status -  77.4/ 80.0 @255 0/8
// Autopid Status -  77.5/ 80.0 @255 0/8
// Autopid Status -  77.6/ 80.0 @255 0/8
// Autopid Status -  77.6/ 80.0 @255 0/8
// Autopid Status -  77.7/ 80.0 @255 0/8
// Autopid Status -  77.8/ 80.0 @255 0/8
// Autopid Status -  77.9/ 80.0 @255 0/8
// Autopid Status -  78.0/ 80.0 @255 0/8
// Autopid Status -  78.1/ 80.0 @255 0/8
// Autopid Status -  78.2/ 80.0 @255 0/8
// Autopid Status -  78.2/ 80.0 @255 0/8
// Autopid Status -  78.3/ 80.0 @255 0/8
// Autopid Status -  78.4/ 80.0 @255 0/8
// Autopid Status -  78.5/ 80.0 @255 0/8
// Autopid Status -  78.6/ 80.0 @255 0/8
// Autopid Status -  78.7/ 80.0 @255 0/8
// Autopid Status -  78.7/ 80.0 @255 0/8
// Autopid Status -  78.8/ 80.0 @255 0/8
// Autopid Status -  78.8/ 80.0 @255 0/8
// Autopid Status -  78.9/ 80.0 @255 0/8
// Autopid Status -  78.9/ 80.0 @255 0/8
// Autopid Status -  79.0/ 80.0 @255 0/8
// Autopid Status -  79.1/ 80.0 @255 0/8
// Autopid Status -  79.1/ 80.0 @255 0/8
// Autopid Status -  79.2/ 80.0 @255 0/8
// Autopid Status -  79.3/ 80.0 @255 0/8
// Autopid Status -  79.4/ 80.0 @255 0/8
// Autopid Status -  79.5/ 80.0 @255 0/8
// Autopid Status -  79.5/ 80.0 @255 0/8
// Autopid Status -  79.6/ 80.0 @255 0/8
// Autopid Status -  79.6/ 80.0 @255 0/8
// Autopid Status -  79.7/ 80.0 @255 0/8
// Autopid Status -  79.8/ 80.0 @255 0/8
// Autopid Status -  79.9/ 80.0 @255 0/8
// Autopid Status -  79.9/ 80.0 @255 0/8
// Autopid Status -  80.0/ 80.0 @255 0/8
// Autopid Status -  80.0/ 80.0 @255 0/8
// Autopid Status -  80.1/ 80.0 @255 0/8
// Autopid Status -  80.2/ 80.0 @255 0/8
// Autopid Status -  80.3/ 80.0 @255 0/8
// Autopid Status -  80.3/ 80.0 @255 0/8
// Autopid Status -  80.3/ 80.0 @255 0/8
// Autopid Status -  80.4/ 80.0 @255 0/8
// Autopid Status -  80.5/ 80.0 @255 0/8
// Autopid Status -  80.6/ 80.0 @0 0/8
// Autopid Status -  80.6/ 80.0 @0 0/8
// Autopid Status -  80.5/ 80.0 @0 0/8
// Autopid Status -  80.3/ 80.0 @0 0/8
// Autopid Status -  80.0/ 80.0 @0 0/8
// Autopid Status -  79.7/ 80.0 @0 0/8
// Autopid Status -  79.5/ 80.0 @255 0/8
// Autopid Status -  79.3/ 80.0 @255 0/8
// Autopid Status -  79.1/ 80.0 @255 0/8
// Autopid Status -  79.1/ 80.0 @255 0/8
// Autopid Status -  79.2/ 80.0 @255 0/8
// Autopid Status -  79.3/ 80.0 @255 0/8
// Autopid Status -  79.4/ 80.0 @255 0/8
// Autopid Status -  79.6/ 80.0 @255 0/8
// Autopid Status -  79.7/ 80.0 @255 0/8
// Autopid Status -  79.9/ 80.0 @255 0/8
// Autopid Status -  80.0/ 80.0 @255 0/8
// Autopid Status -  80.1/ 80.0 @255 0/8
// Autopid Status -  80.3/ 80.0 @255 0/8
// Autopid Status -  80.4/ 80.0 @255 0/8
// Autopid Status -  80.5/ 80.0 @255 0/8
// Autopid Status -  80.6/ 80.0 @0 0/8
// Autopid Status -  80.6/ 80.0 @0 0/8
// Autopid Status -  80.5/ 80.0 @0 0/8
// Autopid Status -  80.3/ 80.0 @0 0/8
// Autopid Status -  80.1/ 80.0 @0 0/8
// Autopid Status -  79.8/ 80.0 @0 1/8
// Autopid Status -  79.6/ 80.0 @0 1/8
// Autopid Status -  79.5/ 80.0 @255 1/8
// Autopid Status -  79.3/ 80.0 @255 1/8
// Autopid Status -  79.2/ 80.0 @255 1/8
// Autopid Status -  79.3/ 80.0 @255 1/8
// Autopid Status -  79.4/ 80.0 @255 1/8
// Autopid Status -  79.5/ 80.0 @255 1/8
// Autopid Status -  79.7/ 80.0 @255 1/8
// Autopid Status -  79.9/ 80.0 @255 1/8
// Autopid Status -  80.1/ 80.0 @255 1/8
// Autopid Status -  80.2/ 80.0 @255 1/8
// Autopid Status -  80.3/ 80.0 @255 1/8
// Autopid Status -  80.4/ 80.0 @255 1/8
// Autopid Status -  80.5/ 80.0 @0 1/8
// Autopid Status -  80.6/ 80.0 @0 1/8
// Autopid Status -  80.6/ 80.0 @0 1/8
// Autopid Status -  80.5/ 80.0 @0 1/8
// Autopid Status -  80.4/ 80.0 @0 1/8
// Autopid Status -  80.2/ 80.0 @0 1/8
// Autopid Status -  80.0/ 80.0 @0 2/8
// Autopid Status -  79.8/ 80.0 @0 2/8
// Autopid Status -  79.6/ 80.0 @0 2/8
// Autopid Status -  79.4/ 80.0 @255 2/8
// Autopid Status -  79.2/ 80.0 @255 2/8
// Autopid Status -  79.2/ 80.0 @255 2/8
// Autopid Status -  79.3/ 80.0 @255 2/8
// Autopid Status -  79.4/ 80.0 @255 2/8
// Autopid Status -  79.6/ 80.0 @255 2/8
// Autopid Status -  79.8/ 80.0 @255 2/8
// Autopid Status -  80.0/ 80.0 @255 2/8
// Autopid Status -  80.2/ 80.0 @255 2/8
// Autopid Status -  80.4/ 80.0 @255 2/8
// Autopid Status -  80.6/ 80.0 @0 2/8
// Autopid Status -  80.7/ 80.0 @0 2/8
// Autopid Status -  80.7/ 80.0 @0 2/8
// Autopid Status -  80.5/ 80.0 @0 2/8
// Autopid Status -  80.3/ 80.0 @0 2/8
// Autopid Status -  80.1/ 80.0 @0 2/8
// Autopid Status -  79.9/ 80.0 @0 2/8
// Autopid Status -  79.7/ 80.0 @0 3/8
// Autopid Status -  79.6/ 80.0 @0 3/8
// Autopid Status -  79.4/ 80.0 @255 3/8
// Autopid Status -  79.2/ 80.0 @255 3/8
// Autopid Status -  79.2/ 80.0 @255 3/8
// Autopid Status -  79.3/ 80.0 @255 3/8
// Autopid Status -  79.5/ 80.0 @255 3/8
// Autopid Status -  79.7/ 80.0 @255 3/8
// Autopid Status -  79.9/ 80.0 @255 3/8
// Autopid Status -  80.1/ 80.0 @255 3/8
// Autopid Status -  80.3/ 80.0 @255 3/8
// Autopid Status -  80.5/ 80.0 @255 3/8
// Autopid Status -  80.7/ 80.0 @0 3/8
// Autopid Status -  80.8/ 80.0 @0 3/8
// Autopid Status -  80.7/ 80.0 @0 3/8
// Autopid Status -  80.5/ 80.0 @0 3/8
// Autopid Status -  80.3/ 80.0 @0 3/8
// Autopid Status -  80.2/ 80.0 @0 3/8
// Autopid Status -  79.9/ 80.0 @0 3/8
// Cycle 4: max: 80.7596, min: 79.197, avg separation: 0.056778
	Ku: 415.561, Pu: 18.8
	Trying:
	Kp: 249.3
	Ki: 26.525
	Kd:   586
PID Autotune Complete! The settings above have been loaded into memory, but not written to your config file.
>>> M500
SENDING:M500
Settings Stored to /sd/config-override

But when I look in config-override I only see these for M103…

M301 S0 P10.0000 I0.3000 D200.0000 X255.0000 Y255
;Max temperature setting:
M143 S0 P300.0000
;PID settings, i_max, max_pwm:
M301 S1 P236.3608 I24.8801 D561.3570 X255.0000 Y255
;Max temperature setting:
M143 S1 P300.0000

The values do not match anything after the test ?

Even more odd is according to the Marlin docs there is no “S0/1” variable.

M301 [C<value>] [D<value>] [E<index>] [F<value>] [I<value>] [L<value>] [P<value>]

Maybe this does not actually work for the bed ?

Marlin != smoothieware.

https://smoothieware.org/supported-g-codes

The example for M301 for smoothieware definitely includes the S parameter.

src/modules/tools/temperaturecontrol/TemperatureControl.cpp clearly has a pool_index variable for S params.

        } else if (gcode->m == 301) {
            if (gcode->has_letter('S') && (gcode->get_value('S') == this->pool_index)) {
                if (gcode->has_letter('P'))
                    setPIDp( gcode->get_value('P') );
                if (gcode->has_letter('I'))
                    setPIDi( gcode->get_value('I') );
                if (gcode->has_letter('D'))
                    setPIDd( gcode->get_value('D') );
                if (gcode->has_letter('X'))
                    this->i_max = gcode->get_value('X');
                if (gcode->has_letter('Y'))
                    this->heater_pin.max_pwm(gcode->get_value('Y'));

I have no idea why it’s not writing those values, just saying that it clearly has code to handle S and Marlin docs don’t imply anything about what Smoothieware handles. If you use a freshly-formatted card with just the configuration file does it by any chance work?

I pretty much have the config file from the smoothie site. The bed does heat up and basically gets to the correct temperature.

I am trying out the extruder now in fact. This one does seem to update the config-override file correctly though.

// Cycle 7: max: 108.642, min: 99.0351, avg separation: 0.411331
	Ku: 67.5914, Pu: 37.45
	Trying:
	Kp:  40.6
	Ki: 2.166
	Kd:   190
PID Autotune Complete! The settings above have been loaded into memory, but not written to your config file.

Hmm. ok odd, the next time I tried it, it didn’t update the file…

I formatted the card and started again…

Now its working, but is there a huge delay for it creating config-override as it doesn’t seem to appear right away. think I might have to restart the board for it to actually show up ? its odd.

// Cycle 4: max: 108.205, min: 99.0764, avg separation: 0.445114
	Ku: 71.1379, Pu: 38.65
	Trying:
	Kp:  42.7
	Ki: 2.209
	Kd:   206
PID Autotune Complete! The settings above have been loaded into memory, but not written to your config file.
;PID settings, i_max, max_pwm:
M301 S0 P42.6827 I2.2087 D206.2110 X255.0000 Y255
;Max temperature setting:
M143 S0 P300.0000
;PID settings, i_max, max_pwm:
M301 S1 P244.3000 I27.1960 D551.0000 X255.0000 Y255

I tried custom settings again, did M500 and the file config-override did not update in windows. So I powered down Smoothie, powered backup and waited for windows to find the drive again, and now the correct file contents is shown.

So don’t know what is going on there but it is annoying to have to keep powering down and starting up because it seems to screw up the USB ports somehow and I have to keep restarting windows to clear the problem :frowning:

Oh! Windows is caching the old contents of the file in memory. It’s not actually smoothieware doing anything wrong here.