Welcome! Log In Create A New Profile

Advanced

PID values for heated bed

Posted by brnrd 
PID values for heated bed
March 16, 2011 07:11PM
I have a Prusa PCB heat bed on my Mendel being controlled by Techzone Gen 3 remix electronics using a modified firmware based Reprap host 20100719 with the addition of codes from Techzone to use their thermocouple AD card for the extruder. I've noticed that I can never reach 100 C if I set the bed temperature to 100. The only way that I can get past 100 is by setting the bed temperature to 140 C and above. Looking at the firmware, I noticed that it uses the same PID values for the extruder and for the bed. I think that this is the problem. I'm sure that the bed needs different PID values. So, I editted the code to use different values as follows:

PIDcontrol:tongue sticking out smileyIDcontrol(byte hp, byte tp, bool b)
{
   heat_pin = hp;
   temp_pin = tp;
   if (b) {
      pGain = BTEMP_PID_PGAIN;
     iGain = BTEMP_PID_IGAIN;
     dGain = BTEMP_PID_DGAIN;
   } else {
     pGain = TEMP_PID_PGAIN;
     iGain = TEMP_PID_IGAIN;
     dGain = TEMP_PID_DGAIN;
   }
   temp_iState = 0;
   temp_dState = 0;
  if (b) {
      temp_iState_min = -BTEMP_PID_INTEGRAL_DRIVE_MAX/iGain;
     temp_iState_max = BTEMP_PID_INTEGRAL_DRIVE_MAX/iGain;
  } else {
     temp_iState_min = -TEMP_PID_INTEGRAL_DRIVE_MAX/iGain;
     temp_iState_max = TEMP_PID_INTEGRAL_DRIVE_MAX/iGain;
  }
   iState = 0;
   dState = 0;
   previousTime = millis()/MILLI_CORRECTION;
   output = 0;
   currentTemperature = 0;
   bedTable = b;
   pinMode(heat_pin, OUTPUT);
   pinMode(temp_pin, INPUT); 
}

And then added the new parameters in extruder.h.

The big question: Has anyone else figured out what PID values to use for the heated bed? I'm sure it will be different based on a number of factors like the bed heat capacity, heater power, etc. But I think yours would be a better starting value than the tip.

Edited 1 time(s). Last edit at 03/16/2011 07:12PM by brnrd.
Re: PID values for heated bed
March 16, 2011 11:16PM
Never mind. I searched the forum and the wiki and found that this has been discussed before. No need for PID control on the heated bed. Bang bang control is fine. I've modified the firmware to do this. I'll post my modified firmware once I've had a chance to test it tomorrow.

Thank you everyone for answering my question before I even asked. smiling smiley

Edited 1 time(s). Last edit at 03/16/2011 11:17PM by brnrd.
Sorry, only registered users may post in this forum.

Click here to login