Who is here? 1 guest(s)
 Print Thread
TC4 - Coding and tech issues
JimG

Quote

greencardigan wrote:
If I used copper wires from the female TC panel connectors to the TC4 what magnitude error will I be likely to have?


The error would be almost exactly equal to the temperature difference between the copper to TC connections at the panel jacks, compared to the temperature read by the ambient sensor on the PCB.

Jim
 
greencardigan

Quote

JimG wrote:

Quote

greencardigan wrote:
If I used copper wires from the female TC panel connectors to the TC4 what magnitude error will I be likely to have?


The error would be almost exactly equal to the temperature difference between the copper to TC connections at the panel jacks, compared to the temperature read by the ambient sensor on the PCB.

Jim

So probably less than 1 degree error if they are both in the same project box. I'll prob just use TC wire to be safe anyway.
 
bvwelch

Quote

greencardigan wrote:
So probably less than 1 degree error if they are both in the same project box. I'll prob just use TC wire to be safe anyway.


Yes, I learned the hard way that temps inside a project box can vary a surprising amount, so play it safe and use TC wires all the way to the screws -- we went to a lot of pain to put that tiny little ambient sensor as close to the screws as possible. :-)

My first project box was strapped to the side of my popcorn popper -- dumb idea -- the 'ambient' got really hot as a result. :-)
 
napier
I have some T-Type thermocouples. I noticed that the code is pretty general in regards to loading the type of Thermocouple. Does a class for a T-Type exist?
 
JimG
There is a type T library here:
http://code.googl...ypeT/TypeT

It was contributed by Jasen. I haven't had a chance to give it a try, but I have every reason to believe it is A-OK.

Jim
 
napier
Amazing. Thanks.
Shock
 
bvwelch
At the heart of the TC4 is a 4-channel, differential input, 18-bit delta-sigma analog-to-digital converter with built-in amplifier and precision voltage reference. This makes it easy (well, it is just software smile to support many different types of thermocouples or even do other measurements that have nothing to do with thermocouples, or a mixture -- different things on each channel. And then there is the cost -- just over $1 USD per channel in single quantities. Amazing little chip.
 
aindfan
Hello everyone,

First of all - the work you've done on this project is amazing. The TC4 and LCDapter boards look great (thanks Jim!), and the code is impressively structured, readable, and modifiable. As you may recall from the other thread, I'm using TC4 to control my Elektra espresso machine. I am starting with Bourbon with a K thermocouple at channel 2 measuring boiler temperature and a T thermocouple measuring group temperature at channel 1. I have made some "hacked" code changes that look so embarrassing next to the rest of the code that they will need some editing before I post them (if anyone's interested - buttons are reconfigured to pull shots and automatically backflush, RoR is not displayed, and timer is reset and counting only during a shot, remaining static on the screen after the shot is done).

I have not set up PID control yet because I wanted to do some temperature monitoring first and see that everything is working, and as I have absolutely no clue how to calibrate TC offset values, this turned out to be a good idea. Based on this guide, I need to:

- Dunk the thermocouple into water known to be at 100C and adjust multiplier for the temperature to read 100C.
- Dunk the thermocouple into an ice bath known to be at 0C and adjust offset for the temperature to read 0C.
- Wait, is that really it?
- I guess these values should be stored in EEPROM as long as it's there

The temperature readings were quite erratic when I set everything up last night, swinging 10-20C (or more), and even when things seemed to stabilize, I wasn't getting a good reading from the group TC (reading around 80C and wavering around there). This morning (after the machine being on for 6 hours, with arduino shut off most of this time), boiler temperature is shown as wavering around 80F and group temperature has been between -20F and 180F. Will calibration/offset values correct all of this? Do I need to check into grounding the negative side of my TC wires?

Thanks again for the amazing work, and let me know if I can help with other parts of code (or anything else)!
Edited by aindfan on 05/19/2011 7:17 AM
 
Bhante

Quote

aindfan wrote:The temperature readings were quite erratic when I set everything up last night, swinging 10-20C (or more), and even when things seemed to stabilize, I wasn't getting a good reading from the group TC (reading around 80C and wavering around there). This morning (after the machine being on for 6 hours, with arduino shut off most of this time), boiler temperature is shown as wavering around 80F and group temperature has been between -20F and 180F. Will calibration/offset values correct all of this? Do I need to check into grounding the negative side of my TC wires?

Definitely does NOT sound like a problem of TC calibration! Try checking that all the pins of the SMD chips are properly soldered, and that you have no short circuits between pins - you'll need a good magnifying glass or a microscope. Your hardware is definitely not functioning, unless its just something you have done with the software. Try loading the original aBourbon and pBourbon software and see whether it gives stable and plausible readings. If it does, then the problem lies with your software modifications.

I was also planning to install a TC4 in my Bazzar A3 (I'm not sure if that is known in the US - it is basically an Isomac Tea), so if you get it working I'll be interested to see what your approach has been with the software.

Good luck!
Bhante

PS - Maybe another thing worth checking is powering the Arduino from a battery (either direct or from a laptop with no mains adaptor connected). What sort of TCs are you using? I would think both should be mineral insulated thermocouples (isolated).
 
aindfan
Bhante, thanks for your reply. I'll check all of the connections, but as for the surface mount components, I ordered the boards populated with surface mount parts from Jim, so I don't think the problem is there.

The probes I am using are the Omega KTSS-18G-12, a 12" stainless steel sheath probe with a grounded junction, and the Omega TC-TT-T-36-36, a 36AWG type T thermocouple, PFA insulated.

Omega states that grounded thermocouples are somewhat susceptible to ground loops - should I ground the negative terminal of the thermocouple at the board? Should I ensure that Arduino ground and espresso boiler ground are connected (and am I risking applying some floating 120Vac ground to the arduino if I do this)? I'll multimeter the voltage between the espresso boiler and arduino ground when both are powered on - this sounds like it could be a problem.

As for the tiny group TC, it is likely a connection problem (those wires are tiny!), so I'll check again.

My modifications don't touch temperature readings (other than using TypeT for TC1 and TypeK for TC2. Standard aBourbon was giving similarly bizarre readings, so I'll chase the grounding issues first.

Thanks again!
 
Bhante

Quote

aindfan wrote:probe with a grounded junction ... Standard aBourbon was giving similarly bizarre readings


If aBourbon was giving the same problems then your problem is with the hardware and/or ground loops. Since your TCs are grounded that is probably your problem. I'm not sure I like the idea of sticking a grounded junction into an espresso machine, but anyway Jim's the man to advise on that. Have you tried powering from a battery? If that works fine, then the ground loops are confirmed.

Bhante
 
aindfan
Right now I'm powering the Arduino from USB, but I can try a 9V battery. I think only the boiler probe is grounded, and yes, I should have thought a step beyond "faster response" and realized that there will be a connection between an IC and an AC area (unlike the decoupling of the SSR).

Thanks!
 
JimG
First thing to try is a ~2" copper loop to short the terminals of one of the TC channels. Under this condition, you should get a fairly steady reading of 70F or so (ambient temperature).

Next (if possible), connect a thermocouple to one of the channels and isolate it from anything conductive (i.e., lay it on the table or hold it in your hand). Check the readings (should still be room temperature), and then pinch the tip between your fingers and make sure the temperature immediately rises.

If you get good results with the copper loop and the isolated thermocouple, but not when the thermocouple is on the machine, then the problem is likely to be related to grounding. Easy to fix by making sure that the shell of your espresso machine and the ground plane on the TC4 are at the same potential. Connect a copper wire from the GNDPT header on the TC4 to a convenient spot on the frame of the machine. If the boiler is not grounded (unlikely), then it would be better to connect the TC4 GNDPT to the boiler instead.

I have had no problem using grounded thermocouples connected to the TC4 on a Silvia, FWIW. But it is absolutely necessary for the TC4 ground plane to be a the same potential as the machine's earth ground. This will not usually be the case if you are using an ungrounded power supply to run the Arduino.

Since aBourbon is a known quantity, I suggest you do the testing with this. But first go into user.h and disable the EEPROM since you have probably not stored calibration values.

The calibration values are really small. Normally around 0.3% adjustment to ADC gain, and maybe 1C or 2C offset adjustment for the ambient sensor. But if the application reads whatever random value is sitting in an uninitialized EEPROM, you will get some very strange results. So until you have put some real values into the EEPROM, you should leave it disabled.

Jim

PS - use this link for the writeCal.pde utility to put some safe default calibration values into the EEPROM:
http://tc4-shield...il/EEPROM/
 
JimG
Regarding calibration, if no calibration instruments are available, I think I would approach it like this:

1. Record the reading in ice bath (Celsius)
2. Record the reading in the condensing steam above a pot of boiling distilled water (Celsius)
3. Subtract ice bath reading from BP reading
4. Compute reference value after adjusting for your local BP (at sea level and standard barometer reading, the reference value is 100.00C)
5. Gain calibration = reference value / measured difference, normally between 1.000 and 1.004
6. Enter the gain calibration in the EEPROM and use it for subsequent readings
7. Record the reading in the ice bath again.
8. Record the reading in the boiling water again
9. Average the errors in these two readings, change the sign of the average, and enter this value into the EEPROM for the offset value.

You can put separate offset values in for type K and type T, but I don't think it is really necessary.

BTW, this system will work VERY WELL without doing any calibration.

Jim
 
aindfan
Jim, thanks for your replies. I initialized the EEPROM values with your program and am currently using aBourbon, freshly checked out from SVN, with LCDAPTER enabled, EEPROM commented out, and CELSIUS commented out. other values are default, and I have made no changes to the code here.

I've had the probe and the surrounding plumbing (see this post to understand my setup - all of the stuff sticking out of the boiler is attached to the probe) sitting in a glass of ice water for some time, and the reading seems fairly stable. In the pot of boiling water, the temperature jumped around a bit (and only once showed above 200F).

I just shorted the terminals of channel 1 with a few strands of the speaker wire that I have lying around (not sure if it's copper, but it's the most likely). The reading on the screen is a solid, unchanging 78F.

Any further thoughts? Could this be a filtering issue (higher value needed)? I am inclined to go with the grounding problem theory - there's about 2V difference between my espresso machine (all metal, including the boiler, is at the same potential) and the GNDPT pins, and connecting Arduino GND to the espresso machine grounding point (the same point as the Gicar ground connected to the case used for the autofill sensor) stabilized the readings.

Thanks again!

p.s. The wire short reading just dropped to 77F.

p.p.s. I'm starting to think that jumpy readings in the pot of boiling water have more to do with moving the probe around than faulty equipment, but I'm not sure.

p.p.p.s. The probe is back in the boiler, and is climbing steadily (through 196F right now) with time. And now, the boiler is starting to sputter steam (vacuum breaker valve), and the temperature is just crossing 212F!
Edited by aindfan on 05/19/2011 7:10 PM
 
aindfan
Ok - all set. aBourbon is working perfectly and I am getting a reaction from both the boiler and group when running a cooling flush.

Any espresso-related feature requests/UI suggestions? I would be honored to take on a Kona-like fully featured espresso program for this project.

Thank you all very much!
 
JimG
Yahooo! More company down in the rabbit hole B)

Jim
 
JimG

Quote

aindfan wrote:
Ok - all set. aBourbon is working perfectly and I am getting a reaction from both the boiler and group when running a cooling flush.

Any espresso-related feature requests/UI suggestions? I would be honored to take on a Kona-like fully featured espresso program for this project.

Thank you all very much!

If you find yourself in need of a simple menu system using the 4-button LCDapter interface, and you can figure out a way to make it general enough to use in other applications, our open source library is really lacking in that area right now.

Jim
 
randytsuch

Quote

aindfan wrote:
Ok - all set. aBourbon is working perfectly and I am getting a reaction from both the boiler and group when running a cooling flush.

Any espresso-related feature requests/UI suggestions? I would be honored to take on a Kona-like fully featured espresso program for this project.

Thank you all very much!


Cool
I was going to start working on adding a tc4/ard to my new to me HX machine. I just installed the grouphead tc in it.

One feature I thought about was safety related. I thought if you turn on the heater for say one minute, and don't see a raise in temp, then shut down. I read somewhere where a guy's tc came loose, and it created a runaway situation that this should catch.

Randy
 
JimG

Quote

randytsuch wrote:One feature I thought about was safety related. I thought if you turn on the heater for say one minute, and don't see a raise in temp, then shut down. I read somewhere where a guy's tc came loose, and it created a runaway situation that this should catch

I've done some fooling around with sensor break detection for possible inclusion in a future TC4 version. You could probably implement it on a perfboard with the existing TC4.

It requires a few resistors and two signal diodes. It works by forcing the incoming TC signal to 600mV or so when there is no sensor, or if the sensor is broken.

PM me for details if you want to give it a go.

Jim
 
aindfan
For the safety setup, I have my heater SSR wired in series with one of the wires from the pressurestat to the heater. Last night, because I was still don't trust the setup, I have the pressurestat set to shut off five degrees higher than the TC4 PID set point, and once I had everything working, I never overshot more than 1 degree (still need to tune more - but I think I'm at P=2, I=1, D=0, not sure though).
 
randytsuch

Quote

JimG wrote:

Quote

randytsuch wrote:One feature I thought about was safety related. I thought if you turn on the heater for say one minute, and don't see a raise in temp, then shut down. I read somewhere where a guy's tc came loose, and it created a runaway situation that this should catch

I've done some fooling around with sensor break detection for possible inclusion in a future TC4 version. You could probably implement it on a perfboard with the existing TC4.

It requires a few resistors and two signal diodes. It works by forcing the incoming TC signal to 600mV or so when there is no sensor, or if the sensor is broken.

PM me for details if you want to give it a go.

Jim


Hi Jim
So it took me a few mins to figure out what you meant, I must be slow today smile.
I was looking at an Omega chart, for a K type TC, 55mv is 2500F, so 600mv is hotter then I would like to be around :eye-popping:
That would work, if it opens up, it goes off the chart hot, and the PID output should go to 0.

Randy
 
JimG
I think that also watching the boiler temp is a good idea. The Watlow 96 has that feature built in for safety. Probably some others do, too.

Jim
 
randytsuch

Quote

JimG wrote:
I think that also watching the boiler temp is a good idea. The Watlow 96 has that feature built in for safety. Probably some others do, too.

Jim


Yeah, so I would have a tc on the grouphead, and one or two on the boiler. Actually, with two on the boiler, if they either get too hot, or the delta between the two is too large, then you could shut down. This should give you a safe pid'ed system.

You could use the 4th ch to measure air temp inside your machine, just because there are 4 to use smile

Randy
 
greencardigan
I did a roast today with just a BT thermocouple connected. Channel 2 was left open.

During the roast the recorded ET gradually increased and then decreased when I cut power to the heater. See the plot attached. The recorded ET started at 22 deg C and ended up at 38 deg C by the end of the roast.

The TC4 board was in open air and well away from the roaster. Why would ET be doing this??

www.greencardigan.com/misc/air_roaster_build/data_logger_controller/roast_6_20110521.png
Edited by greencardigan on 05/21/2011 1:14 AM
 
Jump to Forum: