Dangerous Prototypes

In development => Project development, ideas, and suggestions => Topic started by: unclejojo on October 28, 2011, 07:38:50 am

Title: pid controller(sous vide)
Post by: unclejojo on October 28, 2011, 07:38:50 am
a pid controller(sous vide) as a new project

problem:maybe this is redundant and is included in the soldering iron driver v1

problem:this is a suggestion i wish i had this skills to pilot this project
Title: Re: pid controller(sous vide)
Post by: arhi on October 28, 2011, 12:55:26 pm
it is not a problem that there's a pid in sid but what is the actual thing you would like to control ... pid that make sure a motor keep a position (servo driver), or a hvac system (heating and cooling in home/office) or just a hot plate / hot chamber / hot soldering iron thingy ..
Title: Re: pid controller(sous vide)
Post by: bearmos on October 28, 2011, 06:54:16 pm
i imagine sous vide (http://http://en.wikipedia.org/wiki/Sous-vide) is the end goal here:  basically a simple temperature controlled bath that you put vacuum packed meat into as a method of cooking.
Title: Re: pid controller(sous vide)
Post by: arhi on October 28, 2011, 07:13:32 pm
that's same as soldering iron, you heat the water and that's about all you do. You can copy/paste code from the soldering iron :D ... here you have additional benefit that you directly measure temperature of the water (while soldering iron heats the tip but sensor is in the heater)
Title: Re: pid controller(sous vide)
Post by: bearmos on October 28, 2011, 09:52:45 pm
it's probably also worth noting that the PID constants will almost certainly need to be re-tuned per souse vide setup.
Title: Re: pid controller(sous vide)
Post by: arhi on October 29, 2011, 01:27:15 am
of course, btw, funny story, I tried the exactly the same pid (exactly the same controller :D ) to run my hot plate (500W heater heating 1kg of aluminium) and it worked surprisingly well without any changes in pid coefficients :D
Title: Re: pid controller(sous vide)
Post by: bearmos on October 29, 2011, 04:06:52 am
it's funny how that works out sometimes. 

I've had similar experiences on a few occasions as well - i think when the controller coefficients are optimized towards dynamic stability (reaching a set point quickly, dealing with external stimuli, etc) they tend to work across different processes than the ones they were originally tuned towards.  The ones that don't deal well with different processes are those that are highly optimized for steady state accuracy (usually large integral components).

granted, these are merely casual observations, but it's interesting that you've experienced something similar!
Title: Re: pid controller(sous vide)
Post by: unclejojo on October 30, 2011, 05:08:21 am
Thanks so much for answering my question.
My end game is 'sous vide' I cant wait till that soldering iron driver v1 is complete!!
I was wondering if there was an interest in a "pid controller" project.
Can someone please tell me where i can learn how to convert analog sensors(pt100 sensor) to digital i/o pins of the arduino.
Title: Re: pid controller(sous vide)
Post by: arhi on October 30, 2011, 03:02:10 pm
you don't convert them, you make a voltage divider with pt100 or you make a constant current source and you push constant current to pt100 and then make a small amplifier of the voltage on pt100 and take that signal to analog input on arduino.
here: http://openenergymonitor.org/emon/node/75 (http://openenergymonitor.org/emon/node/75) you have that topic covered pretty good

btw, "pid controller" on it's own is not a project. If you are using arduino and want to control something there's a great pid library for arduino: http://www.arduino.cc/playground/Code/PIDLibrary (http://www.arduino.cc/playground/Code/PIDLibrary)
Title: Re: pid controller(sous vide)
Post by: unclejojo on November 06, 2011, 12:57:54 pm
WOW you got on the blog.
Thank you, I will check these out.
I don't understand what a project is. Why cant a general purpose pid controller be a project?
Title: Re: pid controller(sous vide)
Post by: arhi on November 06, 2011, 03:34:39 pm
[quote author="unclejojo"]I don't understand what a project is. Why cant a general purpose pid controller be a project?[/quote]

pid controller is a project (there's many out there, I gave you link to one), but it is a software project. A hardware project can use a software project for pid controller and control something. If you want to cook stuff at low temperature enough to leave all the parasites alive but for food to be cooked you need a "water heater controller", and in order to make that controller you need

1. sensor to detect temperature of the water (decide if you want to measure only one position or few)
2. maybe a motor that will steer water
3. heater
4. electronics

The electronics will read data from sensor(s), turn the motor on/off and turn heater on/off. One of the algorithms to turn heater on/off depending on the sensor input is a PID control. After you make all that you need to tweak pid parameters for the actual bath you are using (different bath - different paramenters).

If you for e.g. want to make a servo motor controller the similar thing apply, you need
1. motor
2. encoder
3. input signals
4. h-bridge and other electronics

Here you read data from encoder, compare to input signals from outside source (required position, step, direction etc etc) and you control the motor trough h-bridge reading encoder data to know where the motor is. The most used algorithm here is again PID and for each motor and each load you need to configure pid parameters on site.

So as I said, PID is a fairly simple software project - or better say a library (2-3 functions and that's it). It's not that complicated (rather it is very simple) and you can copy paste it from many sources. That arduino pid library is very good for e.g. but you actually need to know "what" you want to control in order to have a hardware project (what dp is mostly about :D ). Lot of ppl that do hvac stuff call "heating controller that uses pid algorithm" a "pid controller", but also the cnc guy's when they say "pid controller" they talk about servo driver .. those can use exactly the same 20 lines of code for pid function but everything else is completely different.
Title: Re: pid controller(sous vide)
Post by: bearmos on November 07, 2011, 02:11:42 pm
Mostly as a side note: generic "PID Controllers" (in the hardware sense) do exist as commercial products. If you're willing to pay for them, Watlow makes some decent stuff that really simple to use called the ez-zone (http://http://www.watlow.com/products/controllers/controller1.cfm?pageid=79&famid=14).  It has everything you need to read data directly from a thermocouple and control a heater.  It will also self-train, so that you don't even need to set PID parameters.  I think the ez-zone express start at around $75, so they're not cheap (you'll also need a thermocouple and heater).  Some models also have programmable profiles, so they can follow ramps.  There are many other generic controllers that can be found on ebay, etc, which are less expensive.

The soldering iron dirve does have everything you need, there will just be a bit of a learning curve (which is usually the point of DIY anyway :-) ).
Title: Re: pid controller(sous vide)
Post by: arhi on November 07, 2011, 05:31:35 pm
ez-zone is again a "heating controller that uses pid algorithm", they are often called "pid controller" but try using it to control anything but a heater :D it won't work... if one want to make "heating controller that uses pid algorithm" that is a regular project, not a bad one at all ..
Title: Re: pid controller(sous vide)
Post by: bearmos on November 07, 2011, 06:13:28 pm
[quote author="arhi"]ez-zone is again a "heating controller that uses pid algorithm", they are often called "pid controller" but try using it to control anything but a heater :D it won't work... if one want to make "heating controller that uses pid algorithm" that is a regular project, not a bad one at all ..[/quote]

They also do a decent job with thermo electrics (for cooling) :-).  Obviously you're not going to use something with a thermistor input for trying to control your servo motor.  In that sense, I suppose it's not really "generic", since there's limited inputs.  I can't remember off hand, but if they have an option for a voltage input, they might be adaptable for applications other than temperature, as long as their loop was running fast enough (not sure how often it's updated).

I do agree that, if one has the knowledge, it's far better to simply roll your own hardware (the "PID controller" being implemented on the micro in most cases) and put exactly the required features on it. . . .thermistor signal conditioning, encoder input, etc.

Again, this was just meant to be more of a side note to point out that ready-made controllers that could be used for sous vide do exist.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01122099600session_write_close ( )...(null):0
20.01152231192ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01152231968Database_MySQL->query( ).../DatabaseHandler.php:119
40.05582370704Database_MySQL->error( ).../Db-mysql.class.php:273