Ss Brewing Technologies Giveaway!

Home Brew Forums > Home Brewing Beer > Equipment/Sanitation > Temperature Controller
Reply
 
LinkBack Thread Tools
Old 12-02-2008, 03:45 PM   #11
kladue
Senior Member
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
Recipes 
 
Join Date: Dec 2006
Location: Turner, Oregon, Oregon most of the time now
Posts: 2,308
Liked 47 Times on 43 Posts

Default

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 Quick reply to this message
Old 12-02-2008, 03:55 PM   #12
bull8042
I like 'em shaved
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
bull8042's Avatar
Recipes 
 
Join Date: Jul 2008
Location: Fort Mill, SC
Posts: 10,279
Liked 445 Times on 443 Posts
Likes Given: 11

Default

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 Quick reply to this message
Old 12-02-2008, 04:02 PM   #13
eccsynd
control freak
HBT_LIFETIMESUPPORTER.png
Feedback Score: 0 reviews
 
eccsynd's Avatar
Recipes 
 
Join Date: Apr 2008
Location: Minnesota
Posts: 175
Liked 1 Times on 1 Posts
Likes Given: 1

Default

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.

Code:
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.
http://www.embeddedcc.com
Become an ECC fan on Facebook

eccsynd is offline
 
Reply With Quote Quick reply to this message
Reply



Quick Reply
Message:
Options
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 DIY Projects 3 08-06-2009 02:10 PM
temperature controller trainfever Bottling/Kegging 6 09-21-2008 05:01 PM