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

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?

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.

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.

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/11050I 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.

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!.....)

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.

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...

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.

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 I'll continue reading and if I ever make up my mind and create something that's working, I'll let you know...

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.

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.

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: 5000D: 5 (too small to likely do anything but I kept it)

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!

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....