Ah, yeah, the 255 is in there because other firmware (eg, Marlin) do that - when Klipper was first released it didn’t have the PID_CALIBRATE command and being somewhat compatible with other firmware was sometimes helpful. It’s an annoying legacy thing. It would be hard to change now as it would break everyone’s current config. (So, not worth the havoc.)
As far as I know, the fopdt HEATER_CALIBRATE tool in this experimental branch works as intended. It might be worth merging into the master branch. (As a tool to help users manually calculate PID parameters.)
I did notice that your manual method uses a power rate of 20%. That may be a better testing mechanism that the full-on system the tool above uses. (In particular, with high power / high thermal mass heaters like your bed.) It’s possible to get the same results by temporarily lowering the max_power
setting to 0.20 in the heater config - but adding a command-line option might be worthwhile to implement.
Cheers,
-Kevin