1 (edited by adrian 2013-03-14 17:44:17)

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 sad .

Anyway - Doing the above has as I said taken my 'saw-tooth' temp and made it a straight flat line! Yay! smile This might help with warping considerably if the bed stays at a proper constant and doesn't have a 5oC deviation for periods.

2

Re: Massively Improved Bed Temp Stability if you enable PID!

Very nice of you!!! Great Job!

3

Re: Massively Improved Bed Temp Stability if you enable PID!

Would this work for a qu-bd silcon heating mat as well?

SD2 - Glass Bed, Fans on PCB and Y motor, Custom enclosure
Slicer - Simplify3D

4 (edited by adrian 2013-03-14 17:13:05)

Re: Massively Improved Bed Temp Stability if you enable PID!

jefferysanders wrote:

Very nice of you!!! Great Job!

Thank you for the comments smile As per below, I meant to say this should also theoretically (at this stage, since can't test, see below) improve your qu-bd beds performance.

wire10ga wrote:

Would this work for a qu-bd silcon heating mat as well?

Yes, I should expect so, and hopefully with the also improved temp curve. I'm still waiting on my qu-bd to be delivered, so can't test myself for you I'm sorry sad Let me know if you have a chance to see if it helps !

5

Re: Massively Improved Bed Temp Stability if you enable PID!

I've been using it for a while with my QU-BD bed and the before and after was significantly improved.
As an aside, I've just had a failure on my QU-BD bed, lucky I ordered two at the time.

6

Re: Massively Improved Bed Temp Stability if you enable PID!

lawsy wrote:

I've been using it for a while with my QU-BD bed and the before and after was significantly improved.
As an aside, I've just had a failure on my QU-BD bed, lucky I ordered two at the time.

mine died also... i just installed another one last week... i thought it was just a bad luck.... but now i see your post and hope it was not a "death by design"

7

Re: Massively Improved Bed Temp Stability if you enable PID!

I'm trying to change the PID settings for my heated bed and I could use some help.  I've read quite a bit on how to do this, and I think I understand some of the steps, but communicating with my Solidoodle motherboard is proving too much for me.  I've emailed Solidoodle support for help, but so far the replies I've got have been (I'll be nice) less than helpful.  I've pretty much given up on getting any useful info from them, and I'm back to trying this on my own.

My printer is an SD3, it's rather new.  Got it in February.


I've run autotune on the bed heater at the temp I want.  That seems to work fine.  I've got the P, I and D values that I want to enter.  I know that I need to modify the Configuration.h file and upload it into my board.

I've read this page:  wiki.solidoodle.com/update-firmware

I've installed the version of Arduino 0022 they recommend.  No problem. 
Under "menu, tools, board" I set COM3 and I've tried the two "Teensylu/Printerboard" recommendations as well as "Sanguino".

The firmware I'm trying to use is:  Marlin_SD3.pde


When I try to compile I get tons of errors with the two Teensylu/Printerboard options, but it seems to compile with the Sanguino option.  I find the Marlin_sd3.cpp.hex file and move it into the Bootloader directory.

Did I mention I downloaded the "Factory Bootloader"?  That's the next step in the instrucions.  I did it. 

I short the boot jumper and reset the board. 

When I run the "hid_bootloader_cli -mmcu=at90usb1286 -w -v Marlin__SD3_.cpp.hex" command it tells me it's programming and it seems to upload fine.  I tried to reset and connect with Repetier, but no luck.  I can't communicate with the board at all.

Back to the command prompt and try to re-upload the firmware.  Now I get: 

Found HalfKay Bootloader
Read "Marlin__SD3_.cpp.hex": 48728 bytes, 37.2% usage
Programming................................error writing to Teensy




Any help would be greatly appreciated.

8

Re: Massively Improved Bed Temp Stability if you enable PID!

I did as adrian wrote but I still get Autotune timeout error even if I started the M303 command near the set temperature.  I'm stumped.

9

Re: Massively Improved Bed Temp Stability if you enable PID!

boksbox wrote:

I did as adrian wrote but I still get Autotune timeout error even if I started the M303 command near the set temperature.  I'm stumped.

What board do you have?

Printit Industries Model 8.10 fully enclosed CoreXY, Chamber heat
3-SD3's & a Workbench all fully enclosed, RH-Slic3r Win7pro, E3D V6, Volcano & Cyclops Hot End
SSR/500W AC Heated Glass Bed, Linear bearings on SS rods. Direct Drive Y-axis, BulldogXL
Thanks to all for your contributions

10 (edited by boksbox 2014-12-05 23:01:45)

Re: Massively Improved Bed Temp Stability if you enable PID!

wardjr wrote:
boksbox wrote:

I did as adrian wrote but I still get Autotune timeout error even if I started the M303 command near the set temperature.  I'm stumped.

What board do you have?

Arduino Mega 2560 R3 / RAMPS 1.4 with a heated pcb bed.