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

Quote

greencardigan wrote:During the roast the recorded ET gradually increased and then decreased when I cut power to the heater.

I had the same when I left T2 open circuit, but when I shorted it with a copper wire the effect was eliminated.

I suspect it is due to a little residual charge remaining in the ADC between readings. Because the ADC only reads one channel at a time and switches internally between the four channels, after reading a higher temperature on T1 there will be slightly more charge difference between the two legs inside the ADC chip at the moment it gets connected to T2. If the two legs of T2 are shorted out then any remaining charge in the ADC will get shorted out, but if T2 is open circuit then it will bias the T2 reading. The T2 tracks (and wires if any) will then act as a charged capacitor, so maybe the charge could accumulate over readings.

Maybe it is worth considering a jumper across the T2 terminals in future versions of TC4, so that it can easily be shorted out when only using one thermocouple? Since we are mainly using T1 and T2 and the software does not read T3 and T4 unless we tell it to do so, I suspect a jumper on T3 and T4 should not be required. Of course, a software "jumper" is also possible!

Bhante
 
bvwelch

Quote

greencardigan wrote:

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



Think of your roaster as a 1500 watt 'space heater'. What you're seeing is just the ambient temperature of the room and the tc4 pcb warming / cooling during the roast. You'll see the same thing if you short out that input with a small piece of bare wire.
 
greencardigan

Quote

What you're seeing is just the ambient temperature of the room and the tc4 pcb warming / cooling during the roast.

The ambient temp didn't get near 38 degrees. That's about 100F. Ambient started at about 71F. I was roasting outside.
 
JimG
Hi, Brad -

I wouldn't spend too much time pondering the apparent ET rise in this case. With an open circuit on channel 2, the results of measurements made on that channel are completely undefined.

Short the terminals of channel 2 with a loop of wire if you would like to have the TC4 report ambient temperature on ET. This would give pretty accurate measurements of ambient. But left open there is no meaning in the measurements.

Jim
Edited by JimG on 05/21/2011 9:26 AM
 
bvwelch
Brad, I suspect the pcb really did get that hot near the roaster (again, think of sitting near a space heater), but it will be interesting if you repeat the experiment with the terminal shorted instead of floating open. We used to record the 'ambient' value in the log file...
Edited by bvwelch on 05/21/2011 6:43 PM
 
Bhante

Quote

bvwelch wrote:Brad, I suspect the pcb really did get that hot near the roaster (again, think of sitting near a space heater)

Bill, that is what happens when T2 is open circuit. Exactly the same happened with mine, and I was sending ambient to the log - it didn't change more than half a degree, but T2 changed roughly proportional to T1. When T2 was shorted the effect was eliminated. Try it.

Bhante
 
JimG
I've written and posted a new command interpreter library (cmndproc) for TC4 applications. Have a look here:
http://code.googl...2Fcmndproc

The library provides a command line parser, a base class for executable commands, and a command interpreter.

The command interpreter class (CmndInterp) contains a linked list of all the commands the user has defined and activated. The user's responsibility is to create their commands, deriving from CmndBase, and simply add them to the linked list (addCommand()). The command interpreter takes things from there.

It reads the Serial line until a newline character is read. Then it parses the command, and passes it to the first command in its list. It continues down the list until one of the commands is executed. Then it goes back to watching Serial.

My current unreleased aArtisan code uses the new library:
http://code.googl...2FaArtisan

That is a little bit of a complicated example, unfortunately. I will post a simpler example for the new library if there is interest.

I think this can be of general use for any TC4 application that needs to respond to more than 1 or 2 commands coming over Serial.

Jim
 
napier
I noticed there is a ambient temperature offset in the TC4 application. Is this the best way to make the offset. I'm trying to calibrate my temperatures and I'm measuring with a multimeter that has a thermocouple. It appears as if the measured temperature is off by something like 15C and once I calibrate it, I increase the temperature by 10C and it doesn't really increase by 10, maybe closer to 5C (with the calibration value).
 
JimG
The offset, if used, would normally be in tenths of degrees. So there is something else causing the problem you are seeing.

You can read the contents of the calibration block in the EEPROM using the readCal.pde program. Load the sketch into your TC4/Arduino using the Arduino IDE, then open a terminal session at 57600 baud (again, in the Arduino IDE). The readCal sketch will print the contents of the EEPROM in the terminal window each time it runs.

Link to readCal.pde: http://tc4-shield...eadCal.pde

A typical value for the gain calibration is 1.004 or less, and for the offset less than +/-0.5C. So the calibration is just fine tuning, and there is very little harm in using a gain calibration of 1.0 and and offset of 0.0.

For errors of 10C to 15C, I would first be suspicious that the thermocouple is not type K.

Second, I would confirm correct operation of the ambient temperature sensor chip by replacing the thermocouple with a short loop of copper wire. The temperature reading should be just a little above room temperature.

Third, plunk your thermocouple into a ice/water slurry. It should give a reading within a degree of 0.0C.

Jim
 
napier
Thanks Jim, it looks like the ebay seller sent me a N-Type based on the color coding of the wire pair. They put a "k-type" label on it though. I am having some very bad luck with thermocouples.
 
JimG

Quote

napier wrote:
Thanks Jim, it looks like the ebay seller sent me a N-Type based on the color coding of the wire pair. They put a "k-type" label on it though. I am having some very bad luck with thermocouples.

For reasons that I can't understand, there is not international agreement on the color codes for thermocouples.

Here is a table that clearly(?) illustrates the problem:
http://www.omega....codes.html

Jim
 
napier
One thing I don't get, and I read PID w/o a PHD, a PID produces a number, but what is the possible range of that number? If I want to get to x evenly, and my heater can be on from somewhere between 1% or 100% of the time, how do I interpret the PID result? I can see that I usually get a 2000+ value from the PID calculation, and the scale of numbers that the PID is creating can really vary.
 
napier
Hmm,

Ambient is reading 52.062500C. Is that correct possibly if the unit is inside a box?

I get -50 for ambient when the thermocouple is in a glass of water with ice. Hrmm.
Edited by napier on 06/07/2011 6:06 PM
 
JimG
What application is loaded in the TC4/Arduino?

Jim
 
JimG

Quote

napier wrote:
One thing I don't get, and I read PID w/o a PHD, a PID produces a number, but what is the possible range of that number? If I want to get to x evenly, and my heater can be on from somewhere between 1% or 100% of the time, how do I interpret the PID result? I can see that I usually get a 2000+ value from the PID calculation, and the scale of numbers that the PID is creating can really vary.

The value varies based on the code. But generally the output from a PID algorithm is a number representing the new output level of the heater. It could range from -1.0 to 1.0, or -100% to 100%.

When the raw calculated new heater output level exceeds 100% then the output is "saturated" and you artificially clip it to 100%. Usually for a heat control PID, if the calculated output is negative, you clip it to zero.

Jim
 
Bhante

Quote

napier wrote:Ambient is reading 52.062500C. Is that correct possibly if the unit is inside a box?

Could be, if the box feels uncomfortably hot to touch.

Quote

napier wrote:I get -50 for ambient when the thermocouple is in a glass of water.

Could be, if the water is cold enough. Take the water out of the glass and put it on the table. Take a sledgehammer and smash the water. If it shatters like glass then maybe the -50 might be right. Note: Be careful not to cut yourself on the water fragments, they may be sharp.

Bhante



(Sorry, couldn't resist!)
 
Bhante

Quote

JimG wrote:For reasons that I can't understand, there is not international agreement on the color codes for thermocouples.

Maybe it depends on what you mean by international agreement. There is an international standard, IEC 584 (1989), and that is now the standard all over Europe. Note that most of the colour codes shown in the chart you posted are the old colour codes from before the international standard. BS 1843 for example is the old British standard dating from 1952, and obviously there are still many factory installations with old colour codes so it makes sense to give the old codes in the tables. Almost all thermocouples and thermocouple wire sold in Europe now corresponds to the international standard.

So there is AN international agreement, but whether everybody agrees with it is another matter.

Maybe its a bit different over there! Do the Americans prefer the old national standards?

I wouldn't be surprised if the international standard specifies Centigrade (which the Americans call Celsius), which might be why the international standard is not so popular in America. Just speculation!

Bhante
Edited by Bhante on 06/08/2011 8:08 AM
 
napier
Okay, It appears to be about 7 degrees off at 25C, and when I set it to 95C it is at about 73. I have to set it to 105C to get 85C. So it appears as if the curve is a lot flatter on this thermocouple. I should have just kept the T-Type I had, since It was about 84 at 95.

Americans love old international standards. Like F and the imperial system!

I might string up another thermocouple to be compatible with my multimeter's plug, and see what kind of temperature values I get measuring with it.
 
Bhante

Quote

napier wrote:Americans love old National standards. Like F and the imperial system!


Yes, imperial was great fun! Great exercise for the brain, which is much needed these days. And so many different standards and measures, all incompatible with each other! There's ounze Troy, ounze Avoirdupois, British fluid ounzes, American fluid ounzes (totally different from British ones) ... there there is the lovely gallon. There are 8 pints to the gallon - but I think there are only 4 US pints to the US gallon, is that right? Yes, those were the days. People still used to be able to think for themselves back then!

Bhante


(Sorry, diverged a bit here!)
 
bvwelch
When you guys finish bashing standards and units, maybe you can answer the troubleshooting questions that JimG raised? Your unit is certainly broken or hooked up incorrectly.

But we'll expect your answers only in furlongs per fortnight squared. :-)
 
Bhante

Quote

bvwelch wrote:we'll expect your answers only in furlongs per fortnight squared. :-)

I'll compromise on Swedish miles per quarter-moon.

Quote

napier wrote:it looks like the ebay seller sent me a N-Type based on the color coding of the wire pair.

What colours are they then (positive wire, negative wire and outer sheath)? You need to start by confirming whether it is in fact N-Type and whether the readings you get correspond to N-Type.

Quote

napier wrote:
Okay, It appears to be about 7 degrees off at 25C, and when I set it to 95C it is at about 73. I have to set it to 105C to get 85C.

What temperature is your cold junction? If both hot and cold junctions are about 25 degrees, the thermocouple should give about zero output, i.e. there should be little or no discrepancy. The other two figures sound more reasonable, given that N-Type has a slightly lower output than K-Type per degree; however don't forget that you are effectively doing the cold junction compensation on the basis of wrong premises, so this will complicate the calculation. If you try to assume a fixed error for the N-Type relative to the K-Type you will get completely different readings as the "cold junction" gets warmer!!

If your thermocouple is in fact N-Type, it should be a reasonable replacement for a K-Type. I see you are a programmer, can't you just write an N-Type library for the TC4, then you can just slot it in and go. Wouldn't that be the easiest solution?

Bhante
 
napier
Yes, at this point I need to figure that I have the right thermocouple. I am going to wire up another length of the wire I got for my multimeter's thermocouple adapter. If it's as bad, or bad in the same direction, then it looks like I either have an N-Type or a bad K type or something else. Looking at the colors, I see red and orange, which is close to red and yellow. It's hard to tell.
 
bvwelch
We'd like to know: 1) what software is loaded into the Arduino? 2) What do your readings look like when you replace your TC with a short loop ( say an inch or two) of bare copper wire?
 
greencardigan
The MCP3424 ADC chip has both address pins held low on the TC4. This gives it the same address as the DS1307 real time clock chip I was trying to use in my roast controller.

Is there any way around this with the current TC4 board layout?

Brad
Edited by greencardigan on 06/16/2011 7:43 AM
 
bvwelch
Hi Brad, there are several options. Which board rev do you have? The simplest option might be to choose a different RTC chip if not too late for your project.
Edited by bvwelch on 06/16/2011 10:14 AM
 
Jump to Forum: