Spike Brewing Giveaway - New v3 Kettle

Home Brew Forums > Home Brewing Beer > Equipment/Sanitation > Temperature Controller
Thread Tools
Old 12-02-2008, 04:45 PM   #11
Senior Member
Feedback Score: 0 reviews
Join Date: Dec 2006
Location: Turner, Oregon, Oregon most of the time now
Posts: 2,305
Liked 52 Times on 47 Posts


One of the components not shown in the PID code was the calculating cycle delay, to short and not enough error difference to make integral and derivative functions work. This was made into a variable that could be adjusted to get needed performance in each application.

kladue is offline
Reply With Quote
Old 12-02-2008, 04:55 PM   #12
I like 'em shaved
Feedback Score: 0 reviews
bull8042's Avatar
Join Date: Jul 2008
Location: Fort Mill, SC
Posts: 10,261
Liked 449 Times on 446 Posts
Likes Given: 11


As for the LM34CAZ, I am using 3 and one is dead-nuts and the other 2 are within 1 or 2 tenths of a degree. I think you will find they are quite a bit more accurate than your run-of-the-mill TC with the exception of the RTD.
As for the freq of your output, I started toying with 1 Hz and went to 40 Hz. First thing to do it toss out your relay and get an SSR with a good heat sink.
The SSR will always be on for multiples of half-cycles (multiples of 8.3 ms). Even with a random turn-on SSR, you have similar issues in that it stays on until a zero crossing. I would consider a PWM frequency more like 1 Hz where you increment the duty-cycle by multiples of 1.667%.

Just my $.02.....
"I brew with a water cooler and some part from the toilet." - JohnnyO

"I do gravity feed the last gallon or two through my Therminator, but I expect you could suck start a Volkswagen before you could suck start one of these. - GilaMinumBeer

"..... Bull was right." - TXCurtis
bull8042 is offline
Reply With Quote
Old 12-02-2008, 05:02 PM   #13
control freak
Feedback Score: 0 reviews
eccsynd's Avatar
Join Date: Apr 2008
Location: Minnesota
Posts: 172
Liked 1 Times on 1 Posts
Likes Given: 1


Hi Jared311.

Another interesting variation on the PID algorithms previously posted is a slight twist on the Derivative term. It uses the position instead of the error in the D term calculation. This seems to work slightly better in practice, although each system is unique.

double UpdatePID(SPid * pid, double error, double position)
  double pTerm,
  dTerm, iTerm;
  pTerm = pid->pGain * error;   
  // calculate the proportional term
  // calculate the integral state with appropriate limiting
  pid->iState += error;
  if (pid->iState > pid->iMax) pid->iState = pid->iMax;
  else if (pid->iState < pid->iMin) pid->iState = pid->iMin;

  iTerm = pid->iGain * iState;  // calculate the integral term
  dTerm = pid->dGain * (position - pid->dState);
  pid->dState = position;
  return pTerm + iTerm - dTerm;
This code is taken from PID Without a PhD. The author explains his reasoning behind the difference from more traditional PID algorithms. This is the approach that I took with the BCS-460 control loops. I believe that the PID code in the Aurdino Playground takes a similar approach.
BCS-460 Temperature Controller - Interactive web based interface, data logging, and programmable control rules.
Become an ECC fan on Facebook
eccsynd is offline
Reply With Quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Johnson Analog Temperature Controller Temperature Profile Coastarine Equipment/Sanitation 4 10-11-2010 03:58 PM
temperature controller chemman14 Equipment/Sanitation 10 09-05-2009 05:15 PM
For Sale - WTB: Temperature Controller gruversm For Sale 10 08-25-2009 04:27 AM
what temperature controller should I use? ohad Fermenters 3 08-06-2009 02:10 PM
temperature controller trainfever Bottling/Kegging 6 09-21-2008 05:01 PM

Forum Jump