Get your HBT Growlers, Shirts and Membership before the Rush!


Home Brew Forums > Home Brewing Beer > DIY Projects > Fermenters > DIY PID controller - beginner Arduino project
Reply
 
LinkBack Thread Tools
Old 05-26-2012, 11:16 PM   #1
chuckjaxfl
Feedback Score: 1 reviews
Recipes 
 
Join Date: Feb 2010
Location: Jacksonville, FL
Posts: 327
Liked 19 Times on 12 Posts
Likes Given: 23

Default DIY PID controller - beginner Arduino project

I am abandoning the DIY PWM project.

A few weeks ago I bought an Arduino UNO, and have really taken to it. The PWM seems like very, very low hanging fruit now.

I though the Arduino was a specific type of microcontroller, or chip, or board. I just knew that it was over my head. What I now know is that the Arduino is not really a specific product, more of a project. The best way I can relate it is to think of America Onlne in the '90s. It took the Internet, put an intuitive, EASY to use face on it, and introduced the masses. Arduino does the same thing for the microcontrollers. You can buy one, watch a few YouTube videos, read a few examples and be working in a few hours.

In my case, I started with a sensor and an LCD display. I added the PID library a few days later, and then the autotune library. I've since connected it to a simple 115 outlet and a crockpot, which I've been using to cook sous vide successfully. Since it was all working on the breadboard ok, I started drawing a little PCB for my buttons, sensor header and such, and then learned that you don't really even need the Arduino part of the Arduino anymore once you've got all the kinks worked out. You can just pull the chip from the Arduino and install that in your project, instead. Get a new $4.30 chip for your Arduino and start all over on a different project.

I wish I had been taking more pictures all along to show you guys. I'll post ones that I have.

__________________
chuckjaxfl is offline
 
Reply With Quote Quick reply to this message
Old 05-26-2012, 11:20 PM   #2
chuckjaxfl
Feedback Score: 1 reviews
Recipes 
 
Join Date: Feb 2010
Location: Jacksonville, FL
Posts: 327
Liked 19 Times on 12 Posts
Likes Given: 23

Default

Here's the rat's nest on the breadboards. It's not as complicated as it looks.

You can see the LCD, as well. In PID mode, it shows the Sv, Pv and current output %.
In manual mode, shows --- for Sv, and in ON/OFF mode, it shows --- for output %.

image-641110172.jpg   image-3879941577.jpg  
__________________
chuckjaxfl is offline
 
Reply With Quote Quick reply to this message
Old 05-26-2012, 11:27 PM   #3
chuckjaxfl
Feedback Score: 1 reviews
Recipes 
 
Join Date: Feb 2010
Location: Jacksonville, FL
Posts: 327
Liked 19 Times on 12 Posts
Likes Given: 23

Default

Here it is now. You can see that the Arduino is gone. The 'big' chip there was pulled from it.
There's less than $10 worth of parts there. Once you add the LCD, the value vs a PID drops. However, I have PLENTY of pins left. I already drew another board that adds $0.40 worth of logic chips (thanks Clearwater Brewer!) that will allow me to run three PID loops from this board, and provide power to three vessels, simultaneously, from the same 30A outlet.

image-3906152047.jpg  
__________________
chuckjaxfl is offline
 
Reply With Quote Quick reply to this message
Old 05-26-2012, 11:41 PM   #4
chuckjaxfl
Feedback Score: 1 reviews
Recipes 
 
Join Date: Feb 2010
Location: Jacksonville, FL
Posts: 327
Liked 19 Times on 12 Posts
Likes Given: 23

Default

Toner transferred, and the etched board. Thanks to those of you who recommended the Sharpie to clean up the transfer. It works WELL.

For the curious, I switched to Eagle light to draw. I was using ExpressPCB, but have learned that the files are proprietary to their service. Eagle was NOT intuitive to me, but worth learning now that I'm using it. It produces industry standard files that I can send anywhere and have a "real" pcb made for me. Plus, with Eagle, you draw your schematic first. Then when you go to make your board, it links all of your components together correctly, you can name each signal, etc. There is simply no comparison between the two.

image-1031617943.jpg   image-891378452.jpg  
__________________
chuckjaxfl is offline
 
Reply With Quote Quick reply to this message
Old 05-27-2012, 12:11 PM   #5
wolfman_48442
Feedback Score: 0 reviews
Recipes 
 
Join Date: Mar 2011
Location: Fraser, MI
Posts: 531
Liked 9 Times on 9 Posts
Likes Given: 2

Default

Very, very nice!
Love seeing interesting projects like this.

__________________
wolfman_48442 is offline
 
Reply With Quote Quick reply to this message
Old 05-27-2012, 02:35 PM   #6
mysobry
Feedback Score: 0 reviews
Recipes 
 
Join Date: Jan 2011
Location: Ivrea, Italy
Posts: 82
Liked 18 Times on 9 Posts

Default

Great !
I'm doing the same with an Arduino board but for controlling the cooling system (peltier waterblock)...same philosophy...PID + PWM output

very enthusiast of the Arduino DIY automation enabler...and I come from the Arduino orginal Town..Ivrea in Italy where arduino project has been started (Via Arduino is few hundred meter from my house ...)

Davide

__________________
mysobry is offline
 
Reply With Quote Quick reply to this message
Old 05-27-2012, 03:06 PM   #7
crane
Feedback Score: 0 reviews
Recipes 
 
Join Date: Sep 2011
Location: San Diego, CA
Posts: 319
Liked 34 Times on 27 Posts
Likes Given: 1

Default

Why would you add external logic chips to gate PID outputs when you can implement all of that functionality with a few lines of code? You can also make it a lot more intelligent that way. There is one major drawback by implementing it with external chips and that is synchronizing the start of lower priority PID outputs to the next higher priority duty cycle. By implementing this logic in FW you can overcome that limitation.

__________________
crane is offline
 
Reply With Quote Quick reply to this message
Old 05-27-2012, 05:20 PM   #8
chuckjaxfl
Feedback Score: 1 reviews
Recipes 
 
Join Date: Feb 2010
Location: Jacksonville, FL
Posts: 327
Liked 19 Times on 12 Posts
Likes Given: 23

Default

Quote:
Originally Posted by crane View Post
Why would you add external logic chips to gate PID outputs when you can implement all of that functionality with a few lines of code?
Uhm.... because I haven't thought it through that far yet? That would make a lot more sense, though.


Quote:
Originally Posted by crane View Post
synchronizing the start of lower priority PID outputs to the next higher priority duty cycle. By implementing this logic in FW you can overcome that limitation.
This part doesn't make sense to me. In my example, if the MLT and the HLT need to be "On" for the same time, my MLT would "steal" the signal from the HLT, the HLT temp would drop, and the HLT would demand a wider pulse and eventually correct itself.

Are you saying, for example, if I'm using 1000ms windows, and my MLT computes that it needs to be on for 350ms, and my HLT needs to be on for 200ms, I should write it that the HLT pulse begins only when the MLT's 350 ends?

That sounds like the more elegant solution, but confusing to write (for right now). Do you have a sketch that I could look at?

Actually, I'm starting to think it through as I'm typing it.
-The output from the highest priority PID would define the pulse width of the first pin AS WELL AS the interval to wait before writing the second pin high.
-Add the output from PID one and two together, that would define the interval to wait before PID three gets to write high.
-If/when the total output of the three makes it to 1000ms, then the computing period starts over again, regardless of which pin is high at the time.

Is that what you meant?
__________________
chuckjaxfl is offline
 
Reply With Quote Quick reply to this message
Old 05-28-2012, 06:34 AM   #9
crane
Feedback Score: 0 reviews
Recipes 
 
Join Date: Sep 2011
Location: San Diego, CA
Posts: 319
Liked 34 Times on 27 Posts
Likes Given: 1

Default

Accidentally hit send while typing.

__________________

crane is offline
 
Reply With Quote Quick reply to this message
Old 05-28-2012, 06:40 AM   #10
crane
Feedback Score: 0 reviews
Recipes 
 
Join Date: Sep 2011
Location: San Diego, CA
Posts: 319
Liked 34 Times on 27 Posts
Likes Given: 1

Default

Exactly. You nailed it. I haven't implemented this so I don't have any code to show you how to do it but it will depend on what system you are using and how the PWMs are implemented.

__________________
crane 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
Arduino Kegerator Temperature Controller luke_l Kegerators and Keezers 9 07-30-2013 01:39 PM
New Open Source Arduino Based PID Controller Released bendiy Brew Stands 9 02-11-2013 09:33 AM
Arduino questions (mash temp controller) Beezer94 Brew Stands 3 06-12-2012 03:53 PM
Arduino+XBee Dual-stage Temp Controller Chuginator Fermenters 65 12-18-2011 09:44 AM
Project Box for Arduino BulldogBrewer Brew Stands 0 09-30-2010 09:27 PM



Newest Threads

LATEST SPONSOR DEALS