PDA

View Full Version : Anybody made a PID Temp control with an Arduino?



texassako
11-04-2013, 07:56 PM
I realized I have an extra Arduino Uno left over from a past project. Anybody ever used one as a PID? I know it has a PID library, but was wondering if anybody here has actually made one. A quick web search shows a lot of other PID uses, but not much on a lead pot which cannot use the sensor I found in the same box(but maybe a lube heater). It looks like it can control 3 devices at once, if need be.

joesig
11-04-2013, 08:06 PM
Is the sensor "just" a thermocouple or is it more like an LM34? If a thermocouple, I don't see why you couldn't make it work. If not, a thermocouple interface for the Arduino.

I'd be interested to hear how you do with this. I've played with the Stamps and that's been about it.

dbosman
11-04-2013, 11:23 PM
Arduino compatibles are dropping in price too. By the way.
http://borderlesselectronics.org/
$9.00 when they did the first batch.

texassako
11-05-2013, 01:14 AM
Is the sensor "just" a thermocouple or is it more like an LM34? If a thermocouple, I don't see why you couldn't make it work. If not, a thermocouple interface for the Arduino.

I'd be interested to hear how you do with this. I've played with the Stamps and that's been about it.

It is a one wire digital sensor, DS18B20. I guess I need to go read the builds I found for coffee maker/sous vide/toaster(must really like toast) PID controllers. They should be adaptable to a lead pot, just a different temperature range.

texassako
11-06-2013, 01:04 PM
I have been browsing various builds here(non Arduino) and on the web. I have a little cartridge heater on the way, and it will be a PID controlled lube heater for my Lyman 450 with the DS18B20 temp sensor and an aluminum block. I am thinking of using PowerSwithTail's kits for the switching. Once that first project is up and running, I will move on to adding the thermocouple for the lead pot. The PST switch is rated for 15 amps, but my pot is only 500 watts. I am not sure of the wattage in some of the larger pots out there, but it could be a better option for some than the SSR used in the sticky builds. I still need to figure out the display, buttons, and thermocouple amplifier.

Update: The PST is a mechanical relay only good for 100k switches, not good for this application except while experimenting.

7Acres
11-06-2013, 10:52 PM
I'm very interested in how your arduino based PID turns out. I'd love to write an app that graphs temp swings during an entire casting session. And includes a software dashboard with temp guage indicators. Extremely nerdy and not very common-man. But could be lots of fun!

texassako
11-07-2013, 12:18 AM
I'm very interested in how your arduino based PID turns out. I'd love to write an app that graphs temp swings during an entire casting session. And includes a software dashboard with temp guage indicators. Extremely nerdy and not very common-man. But could be lots of fun!

One thing at a time, but it would be doable. I did it with a weather station I made. The 16x2 screen I have is a bit small to show much info, but there are larger displays. Ordered the rest of what I need, and a RF receiver and 4 button remote to try out. A few important pieces will not be in for a few weeks; so I will get started with controlling my hot plate for mold preheat in the mean time.

jim147
11-07-2013, 12:54 AM
I thought that sensor got a little iffy over about 212F. I have a bunch of them on order for a custom controls project based on the RPi but they will be used in walk in and reach in coolers.

I'm sure the Arduino will work, just not sure about the sensor choice with lead.

I think the high temp one wire sensor is a dt100. I'm not sure what resistor you would need with it.

Keep us posted.

jim

texassako
11-07-2013, 01:42 AM
I have some k type thermocouples on their way for the lead. Also going to try a pt100 rtd because the amplifiers for thermocouples are a bit pricey.

texassako
11-08-2013, 08:16 PM
I have been looking at using the rest of the Arduino pins a bit more. I had not thought about adding a temp probe for the mold itself. Maybe even wireless? The sensor cord looks annoying to have attached to the mold. The more I look at it, the more I see could be added to a single Arduino.

ChuckJaxFL
01-16-2014, 12:40 AM
Anyone go any further with this?

I use the PID library for beer brewing with a DS18B20 sensor. I've drawn up a little board that uses an ATTiny84, an 8x2 LCD and the DS18B20 as a PID controller. Link here (http://www.homebrewtalk.com/f51/attiny84-pid-408338/) for those interested. It would also work perfectly for a lube heater as-is. The datasheet on the DS18B20 indicates it will read to 257F/125C. Not useful for a lead pot. But, I'm guessing that if we follow the well-beaten path of those that are using toaster ovens for reflow soldering, we would do well. They're using MAX31855 chips and a K type thermocouple. Perfect, no?

I bought a section of 4.5" pipe, with the intent on building a pot, but have gone no further. I'll use an ATtiny84 or ATtiny85, or maybe an ATmega328, and I'll either draw up a board and etch it in my sink, or I'll send the files out to have a board made. I won't commit an entire UNO to the project, though.

I think the challenges will be similar in the lead pot as they are in brewing, temperature oscillations in 12-15 gallons of water are SLOW, and if you overshoot, you're screwed because you kill enzymes. Maybe less traumatic in casting.

If anyone gets started on this project before me, I'll suggest using the adaptive tuning examples and keep the I & D terms at 0 until you are close close close to target temp, then add a touch of I and D to correct the error.

ChuckJaxFL
01-16-2014, 12:51 AM
This is the setup. The vessel is a keg w/ a 5500w water heater element mounted in it.
93661

These are the response curves that the Arduino PID library can do. Each "tick" is about a tenth of a degree F, a sixteenth C.

ramping up:
93662

and holding:
93663

So, I'm sure that the Arduino is suitable.

dikman
01-16-2014, 06:17 AM
Most anything is possible, if you throw enough resources at it, but other than being an interesting experiment I can't see the value in it. As for being able to graphically plot the temperature of the sensor, my question would be - why would you want to? Melting lead in a casting pot hardly qualifies as a "laboratory grade" function.

Most guys on here can cope with a PID-type controller setup (whether as a kit or separately sourced components), but an Arduino-based system? Bit over-the-top, methinks.

Plus I wouldn't want my laptop anywhere near me when melting lead!

But I will be interested to see the end result of your efforts.

texassako
01-18-2014, 11:37 PM
I am a bit stumped at the moment, but mostly because I am not much of a programmer. Currently I have a thermocouple setup running as a digital lead thermometer using a cheap surplus lcd. Another setup is functioning as a PID lube heater using a 200w cartridge heater, chunk of aluminum, a 12v wall wart(lowers the wattage of the heater and supplies power to the Atmega chip), and a one wire temp sensor. I just can't seem to get the thermocouple to function in the PID sketch I modified, just low temp sensors like a one wire digital or an analog sensor. I did make a bang-bang pseudo-PID using a stepper motor to turn the knob on my Lee 4-20. I am working on it so the stepper will eventually use the PID library function to find the best location on the Lee dial to maintain temp, if I can ever get the thermocouple to play nice with a sketch meant for lower temp one wire sensors. The nice thing is the whole setup fits inside a mint tin since I don't need a SSR, the digital thermometer only cost about $15 in parts, and the PID lube heater $20. They still need to be moved from breadboard to a more permanent board.

dikman
01-19-2014, 12:44 AM
I think the lack of responses sums up the general interest in the concept. Non-the-less, I applaud your determination texassako. Nothing like a challenge to keep the brain cells churning (although in my case it usually ends up making my brains hurt!).

el34
01-20-2014, 06:51 PM
I did make a bang-bang pseudo-PID using a stepper motor to turn the knob on my Lee 4-20.

That rocks! I love inventiveness like that!
I'd call it an Artificial Intelligence Robot controlling the pot.

What stepper driver chip?

texassako
01-20-2014, 08:27 PM
That rocks! I love inventiveness like that!
I'd call it an Artificial Intelligence Robot controlling the pot.

What stepper driver chip?

It is the cheap little ULN2003 control board that came with my 28BYJ-48 stepper motors. I chose that stepper because there is a library already for it(CustomStepper), and I set it up using rotateDegrees so 0 degrees is 1 and on, and 10(can't remember the degrees right now) is on. A little aluminum bracket and a homemade coupling with set screws join it to the thermostat knob.

el34
01-20-2014, 09:04 PM
Did you get it working?

texassako
01-20-2014, 10:37 PM
Did you get it working?

I only had it working as a temporary digital thermostat using a thermocouple. Ran the stepper real slow and set it up for on at 2 degrees below target and off at 2 degrees above. I cannot figure out how to plug the thermocouple into the PID sketch I a have. It will have to wait until it is hot enough outside to force me indoors since the good outdoor project weather is coming up.

Boolit_Head
12-15-2014, 05:52 PM
I was thinking the same thing and it is looking like it could be done. Using the same thermocouple used for the pid might work with the amp from Adafruit.

http://www.adafruit.com/products/269

Toss in a 110 volt relay to turn on/off the juice and a LCD for a output with a POT to adjust the set point. Now to figure out how to draw power from the 110 volt that would be present...

The only thing left would be to write the sketch...

HATCH
12-15-2014, 06:23 PM
I don't know why you want to do this
A PID is just $10 US from hong kong.
http://www.ebay.com/itm/NEW-AC110-240v-PID-Digital-Temperature-Control-Controller-Thermocouple-0-to-400-/271705363917?pt=LH_DefaultDomain_0&hash=item3f42e6d5cd

Comes with a TC that you could use on a lube heater.

mattw
12-15-2014, 07:09 PM
You will need a MAX3185 interface board then you can use the PID library. The one-wire units do not go to the high temps that are needed. I have built and programmed fish tank controllers and am considering trying a pid controller. I have several extra arduinos. Look at the digispark, the whole unit could be built in a box big enough to hold the required SSR and use an aluminum case for the heat sink. We are talking a pid the size of a pack of smokes!

texassako
12-15-2014, 09:31 PM
My annual shift to indoor hobbies is about to begin, and this project is on that list. I think I have the sketch figured out in my notes. I just need to unbox the hardware, I have everything already. For those who wonder why, it is just because I can.

dikman
12-16-2014, 05:30 AM
For those who wonder why, it is just because I can.

What other reason does anyone need? :drinks:

texassako
12-16-2014, 10:18 AM
Here is what I found a few months ago for this build: http://www.jameco.com/Jameco/Products/ProdDS/2190178KitInstructions.pdf?CID=CLB
The picture in the link shows just how small a PID could really be. Obsessed coffee drinkers have been a great source of info on PIDs.

Tazza
12-18-2014, 05:24 AM
This is quite interesting.

I have automated my master caster with an arduino using code from Kayak1, having it control the pot would have been quite handy actually, saving adding more to the control box.

I just wonder if it's reliability is good enough to not allow it to do something and let the temperature go crazy on you.

Yet a dedicated PID is very cheap and easy to install. I have a little PID in my setup

HATCH
12-19-2014, 09:35 PM
Pids are very inexpensive so unless the ardunio is free in don't see the point. Also I don't know how good it is at multitasking. It would suck to have the ardunio freeze on lead pour cause it was dealing with pid control.

Tazza
12-19-2014, 11:13 PM
Agreed mine liked hanging and dropping lead.... it made a mess that's for sure.

texassako
12-20-2014, 01:27 PM
Pids are very inexpensive so unless the ardunio is free in don't see the point. Also I don't know how good it is at multitasking. It would suck to have the ardunio freeze on lead pour cause it was dealing with pid control.

I already have the bits; so it really doesn't cost anything at this point. I only use an actual Arduino Uno to prototype with and program a ~$5 clone for final projects. Writing a PID sketch with a thermocouple has been my stumbling block. Once I get the thermocouple integrated, one Atmega328 chip should be able to act as 3-4 PIDs at once or use a smaller, cheaper chip. Like I said before, it is just another hobby of mine to mess around with and a useful project is always a plus.