Topic: Massively Improved Bed Temp Stability if you enable PID!
I just thought I'd throw out there that there is an easy way to massively improve your bed's temp stability. It's been mentioned in passing in other threads, but thought I'd make a clear thread for other newbies. The current SD3 beds are proper 'power beds' using Nichrome, making it possible to use PID effectively on the bed rather than just bang-banging to a set point on a resistor that is only centrally mounted. If you're unsure what type of bed you have, just check underneath feeling around the centre of the heat matting. If there is a noticeable lump - you have the 'older' style bed and are better off continuing as is as the hysteresis on that setup is huge. If you have no discernible lumps or crowns in your matting, congratulations, you have a 'power bed'.
EDIT: This should work with a qu-bd silicon mat as well as home made nichrome jobs as well or a PCB Heat Bed. I haven't tested anything other than on a standard bed, but the theory would continue to apply to other beds.
By enabling the
#define PIDTEMPBED
in Configuration.h of the firmware, along with
#define BED_LIMIT_SWITCHING
I've seen a change from a 'saw tooth' temp graph on my bed with a +/- 5oC swing, to having it sit flatline @ the set tempreature. Its been constant in an unenclosed setup for over 20 mins with nary a dip in sight. Trade off though was a slightly increased duration to reach the set point.
It is important when you setup the PIDTEMPBED that you move down and follow the comment from the code:
//FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
I first defined just a standard bed PID, compiled and uploaded the firmware. The next bit is to *manually* enable the bed and get it up to 90oC. If you try and run the M303 tune on a standard bed that is at ambient, it will actually timeout from the auto-tune function before it even gets close to 90o. So heat that bed up using manual, and then do the M303 E-1 command above. Once it runs, you'll get the same error condition as you do when pid-tuning the extruder. Disconnect/Reconnect and then make a note of the last "Classic PID" details returned from the auto-tune.
You now need to create your own "pidautotune" entry in Configuration.h. I just cut n pasted the previous settings, commented those out, and then set the defined values to what I got via the auto-tune.
So now my configuration.h in the relevant section (Lines 161-183 in current lawsy-marlin) looks like:
#define PIDTEMPBED
//
#define BED_LIMIT_SWITCHING
// This sets the max power delived to the bed, and replaces the HEATER_BED_DUTY_CYCLE_DIVIDER option.
// all forms of bed control obey this (PID, bang-bang, bang-bang with hysteresis)
// setting this to anything other than 256 enables a form of PWM to the bed just like HEATER_BED_DUTY_CYCLE_DIVIDER did,
// so you shouldn't use it unless you are OK with PWM on your bed. (see the comment on enabling PIDTEMPBED)
#define MAX_BED_POWER 256 // limits duty cycle to bed; 256=full current
#ifdef PIDTEMPBED
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, argressive factor of .15 (vs .1, 1, 10)
// #define DEFAULT_bedKp 174.56
// #define DEFAULT_bedKi 21.65
// #define DEFAULT_bedKd 351.78
//120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
//from pidautotune
// #define DEFAULT_bedKp 97.1
// #define DEFAULT_bedKi 1.41
// #define DEFAULT_bedKd 1675.16
//Solidoodle3 Standard Bed
//from pidautotune
#define DEFAULT_bedKp 100.15
#define DEFAULT_bedKi 7.65
#define DEFAULT_bedKd 327.90
// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
#endif // PIDTEMPBED
You then of course need to recompile and reupload (a simple matter of ensuring RH is disconnected, then hitting upload in the Arduino IDE).
Alas, the "Firmware Settings" option in RH is not applicable for Bed PID settings as they are not currently stored in EEPROM, only within the firmware source code .
Anyway - Doing the above has as I said taken my 'saw-tooth' temp and made it a straight flat line! Yay! This might help with warping considerably if the bed stays at a proper constant and doesn't have a 5oC deviation for periods.