Author Topic: Help needed with electronics  (Read 1935 times)

Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Help needed with electronics
« on: March 08, 2013, 01:54:28 AM »
Hi folks.
As a cheese vat I'm using an electric heated canning kettle. I have an electronic thermometer and I control the temperature by switching the electricity manually on and off.
I'm thinking about using an Arduino Uno and a laptop to control this process. The programming shouldn't be a problem since I'm a software engineer. With the electronics I need help.
First of all to decide which parts to use for heat sensor (resistant to milk and whey!) and for switching 220V and secondly how to connect this stuff.
Anybody out there who has done this before?

cheers,
Herman
- Herman -


Guests, join the CheeseForum.org community to remove this ad.


Offline BobE102330

  • Mature Cheese
  • ****
  • Location: Upstate New York
  • Posts: 403
  • Cheeses: 19
  • chilihead/cheesehead
Re: Help needed with electronics
« Reply #1 on: March 08, 2013, 05:43:32 AM »
Hi Herman,

I'm in the process but instead of a laptop/ Aurdino based solution I'm using a PID controller. You'll need a stainless or Teflon coated thermocouple or RTD (Possibly a way to interface this with the Aurdino) and a solid state relay capable of taking logic level inputs. You might need a resistor to limit the current drawn by the SSR.

Thermocouple http://www.amazon.com/gp/product/B005G14R70/ref=oh_details_o03_s01_i02?ie=UTF8&psc=1

RTD http://www.amazon.com/gp/product/B0052IGFZ4/ref=oh_details_o04_s00_i02?ie=UTF8&psc=1

Solid State Relay http://www.amazon.com/DC-AC-Solid-State-Relay-Heatsink/dp/B005K2IXHU/ref=pd_sim_indust_4

PID Controller http://www.amazon.com/gp/product/B004HHW2P8/ref=oh_details_o04_s00_i00?ie=UTF8&psc=1 

The PID type I should have purchased with RS85 interdace http://www.amazon.com/JLD634-Temperature-Controller-FURNACE-RS485/dp/B0056OUEYW/ref=sr_1_3?s=industrial&ie=UTF8&qid=1362743798&sr=1-3&keywords=ramp%2Fsoak+PID

PID means Proportional Integral and Derivative, a control process that allows tighter control than the usual thermostat type of control.  Something to consider when you write your control program. http://en.wikipedia.org/wiki/PID_controller  I wish I had purchased the RS 485 controller so I could program the controller with my computer - a lot easier for different cheese makes than using the controller buttons.
« Last Edit: March 08, 2013, 06:08:15 AM by BobE102330 »

Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #2 on: March 08, 2013, 08:12:19 AM »
Thank for the info Bob. That thermocouple looks promising, I was looking for something like that. I sure have a lot to read....
- Herman -

Offline stratocasterdave

  • Medium Cheese
  • ***
  • Location: River Falls, WI
  • Posts: 54
  • Cheeses: 2
  • Default personal text
Re: Help needed with electronics
« Reply #3 on: March 08, 2013, 08:21:13 AM »
Adding to what Bob says, yes, a PID is the way to go in my opinion.  Another good source or parts and complete controllers is here:  http://www.auberins.com/

I bought from them and have been satisfied.

Dave

Offline mdmoore00

  • Medium Cheese
  • ***
  • Location: Butte, MT USA
  • Posts: 28
  • Cheeses: 5
  • -- Matt --
Re: Help needed with electronics
« Reply #4 on: March 08, 2013, 09:47:34 AM »
I'm I'm the process of configuring an Arduino setup. I bought the 1 wire sensors like the following:https://www.sparkfun.com/products/11050
I am currently adapting a sketch from another PID project to suit my system. The Arduind community is like the cheese community, very helpful. I will post my system once I get it running.


Guests, join the CheeseForum.org community to remove this ad.


Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #5 on: March 09, 2013, 06:30:33 AM »
Guys, to be honest, I'm quite a newbie to electronics on this level but I'm not sure why a PID is the way to go. Let me explain:
I'm a Delphi programmer and I noticed there are examples of Delphi programs working with Arduino boards using the com port.
What I want to do is switch the power of the kettle on or off, depending on the readings of a temperature sensor. When the power switches and for how long is going to be decided by a Delphi program, using the rise in temperature per minute, the amount of fluid, current temperature and target temperature etc.
In future I maybe also switch an overhead stirrer on and off, based on the timing in the program and the recipe I'm using (don't call me lazy!.....)
- Herman -

Offline BobE102330

  • Mature Cheese
  • ****
  • Location: Upstate New York
  • Posts: 403
  • Cheeses: 19
  • chilihead/cheesehead
Re: Help needed with electronics
« Reply #6 on: March 09, 2013, 07:49:35 AM »
Could you write the program to make the USB signal go high when you want the heater on and off when not? Perhaps a pulse width modulation to control heating rate?  If so you may be able to drive a SSR directly from the USB port without an Aurdino.

My PID suggestion was based on the value of your time. It's preprogrammed and costs about twice an aurdino. So it is cost effective unless you want the programming experience. How much programming do you want to do for 30 Euro?  A complex process control might make sense to program yourself but this simple type of process lends itself well to a commodity controller.

Much the same discussion I have with my girlfriend who keeps reminding me that I can just buy cheese. ;)


Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #7 on: March 09, 2013, 08:44:59 AM »
LOL, I'm happy that I can buy raw milk for a very reasonable price, otherwise I would loose the competition with the supermarkets as well....
I just had a look at DealExtreme and they are offering Arduino sets for very low prices.
One of the disadvantages of my kettle is the fact that the heating continues for a while when the power is off and the effect of that is bigger when the amount of milk is smaller. So my conclusion was that the only way to control this was with a good algorithm.
And I'm busy with software for the "cheese production" anyway...
- Herman -

Offline BobE102330

  • Mature Cheese
  • ****
  • Location: Upstate New York
  • Posts: 403
  • Cheeses: 19
  • chilihead/cheesehead
Re: Help needed with electronics
« Reply #8 on: March 09, 2013, 09:05:20 AM »
Of course I am coming from the perspective that last time did any programing it was using punch cards and Fortran. (Did you have to search to find out what that is?)  Several software package customizations for work took forever and $$$$$ for what I thought were simple issues.  So I shy away from custom software, even with a fairly accomplished son in that arena. 

PID is the algorithm you want. ;) 
 
Many controllers have auto-tune functions that automatically calibrate the values to minimize overshoot.  Of course that works at one milk volume.  My plan is to run autotune for various make sizes and record the values. 

I pay just a $1.50 premium for raw milk over the grocery store stuff.  I'm lucky, too. It's taken me a couple of years to convince her that cheese is not just a vehicle for eating mustard.

Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #9 on: March 10, 2013, 05:09:51 AM »
Well, I was born somewere halfway the previous century.... Ugh, that sounds awfully...
On highschool I learned programming with punchcards and once I had a Fortran compiler for a home computer, using casette-tapes. Indeed I think a lot of people will Google now  :D
I'll continue reading and if I ever make up my mind and create something that's working, I'll let you know...
- Herman -


Guests, join the CheeseForum.org community to remove this ad.


Offline pirenzi

  • Young Cheese
  • **
  • Location: Leuven, Belgium
  • Posts: 14
  • Cheeses: 2
Re: Help needed with electronics
« Reply #10 on: March 10, 2013, 01:23:01 PM »
Hello Herman,

I am very interested in what you are doing with regard more to the software implementation for the controller. I am a mathematician by trade an also have much experience with programming, and not so much with the electronic setup. I feel like PID control in software should not only be easy to implement, but also infinitely customizable once you start using it.

As far as I understand, PID just requires that you do the following:

1) Calculate the error in your measured temperature to the desired temperature:
error = desired_Temp - current_Temp

2) Calculate the derivative term:
deriv = error - last_error

3) Accumulate the integral of the error:
integral = last_integral + error

Then add them together to give your output function (where K_proportional, K_integral and K_deriv are constants to control the proportion each term contributes to your control).

output = K_proportional*error + K_integral*integral + K_deriv*deriv

Since you are only able to heat your kettle,  the sign of this variable will tell you if you need to turn on the element or not. In short, the actual implementation of the PID control should be very straightforward.

I am interested in what you come up with.

Regards

Piers

Offline Boofer

  • Old Cheese
  • *****
  • Location: Parkland, Washington
  • Posts: 4,231
  • Cheeses: 205
  • Contemplating cheese
Re: Help needed with electronics
« Reply #11 on: March 11, 2013, 08:54:17 AM »
using punch cards and Fortran.
Honey, it's a bit cold in here. Run out to the garage and fire up the Eniac, would you please? ;)

I'll call the power company and tell them we'll be running it for a while.

-Boofer-
Let's ferment something!
Bread, beer, wine, cheese...it's all good.

Offline kdttocs

  • Medium Cheese
  • ***
  • Location: San Diego, CA
  • Posts: 38
  • Cheeses: 4
Re: Help needed with electronics
« Reply #12 on: April 05, 2013, 01:32:43 PM »
Whether PID or arduino (you'll essentially be making a PID with the arduino), using a RTD is highly recommended. If using a thermocouple, it's difficult to add a D value of any significance. The D value essentially adds a predictive function to the PI values so that your system doesn't over/under shoot temps. It smooths out the temperature curve over time. Thermocouples are too sensitive. You'll find your temperature jumps around alot as different temperature liquids swirl around the vat. The jumping temps confuse the heck out of "D".

With that said though, I've found you can generally pull off a PID with a thermocouple but just running in PI mode (setting D to 0). The only issue this creates is under initial heat ramp up, the water bath temp overshoots your target. But if you have cooler milk in the water bath it brings the water temp down quicker than the milk can heat and eventually stabilizes quite well.

My most recent run with my PID was for both a 60 hour short rib sous vide at 134.6F and then a Caerphilly make at 90F. Using a turkey roaster, thermocouple (same one linked below) and a cheap Harbor Freight water pump I was able to keep both extremes to within +-0.1F of target temp. This was after trying to autotune and eventually starting from scratch with basic values. Here were my values:

P: 5% (.05)
I: 5000
D: 5 (too small to likely do anything but I kept it)

Here is a site I found that helped me grasp the PID values better without needing a PhD in physics.
http://radhesh.wordpress.com/2008/05/11/pid-controller-simplified/

Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #13 on: April 08, 2013, 09:52:55 AM »
Hi kdttocs, thanks for the contribution, but what you're writing is way over my head unfortunately  :-[
I received half of my order last Saturday, the remaining part was in backorder, but I hope to receive that in a week. I had posted something in a Dutch Arduino forum and I got some directions there. I even found a sketch of an Arduino program from a hobby beer maker who made something similar....
I'll keep you all posted!
- Herman -

Offline hoeklijn

  • Old Cheese
  • *****
  • Location: The Netherlands
  • Posts: 703
  • Cheeses: 43
  • Say cheese!!
Re: Help needed with electronics
« Reply #14 on: April 21, 2013, 08:28:09 AM »
Hi folks, little update on this project:
Finally received all the stuff that I ordered. It came in two shipments because some parts (also the Arduino Uno) were in back order.
It's fun to work with. I made a small program in the C language that is used on the Arduino (The programming environment and loads of examples are freely downloadable) and that is uploaded to the Arduino's microprocessor and starts running when the Arduino is connected to a PC with a USB-cable. It simply reads the temperature from a waterproof probe, sends it to the serial port and waits a while for an answer.
In Delphi I wrote a small program that is reading the temperature that was send to the serial port and when needed gives a signal back that is read by the Arduino to switch some leds and the relay on or off.
Next step is to add this as a plugin to the "production program" I'm working and workout the algorithm for the heating....
 
- Herman -