topbanner.gif
Login
Username

Password




Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Shoutbox
You must login to post a message.

renatoa
05/23/2022 10:46 AM
abiy welcome cup

renatoa
05/18/2022 6:13 AM
gnosis coffee roasters and Terry Hauser, welcome !

allenb
05/15/2022 7:00 PM
lsawade welcome Welcome

renatoa
05/15/2022 9:13 AM
Welcome, Pinofly and Alex008

allenb
05/12/2022 7:47 PM
CafficitoeTim and pmf2000 Welcome! Welcome

In Memory Of Ginny
Donations

Latest Donations
dmccallum - 10.00
JackH - 25.00
snwcmpr - 10.00
Anonymous - 2.00
Anonymous - 5.00
Users Online
Guests Online: 6

Members Online: 0

Total Members: 7,580
Newest Member: abiy

View Thread

Who is here? 1 guest(s)
 Print Thread
TC4 - Coding and tech issues
JimG
Something that I perhaps should have pointed out earlier in this discussion, but to be honest it just occurred to me :|

Back when Ed and I were first fooling around with RoR measurements, I was using a completely analog system. The circuit was designed and calibrated to output an analog signal equal to 1mV per degree rise per minute (F scale).

The first version was noisy as hell!

Using a Fluke DMM, I captured a bunch of the output and it looked a whole lot like the unfiltered results from aBourbon. I played around with some options in Excel, etc.

The solution ended up being low pass RC filtering on both the input and the output of the differentiator. I think the time constants for those filters was in the same ballpark as our current digital equivalent.

So I have been operating under an understanding (assumption?) that the quantization errors are not the bad guys. The actual bad guys are the real fluctuations in the temperature signal.

Jim
 
JimG

Quote

Bhante wrote:
... Firstly on ambient temperature: my experiments with breathing on it show that it is extraordinarily sensitive to change, but I see this as valid data not noise, and should be used in the correction of the raw thermocouple readings because the ambient temperature does actually change and the cold junction error changes with it....

What we really care about are the temperatures at the ends of the TC leads, inside the wiring terminals, at the junctions between TC wire and copper. The ambient temperature sensor is just a proxy.

The wire terminals and the TC leads are both more massive and less exposed, so they will not fluctuate as quickly. I think putting some filtering on the ambient sensor makes sense at least for this reason if not for reasons of noise filtering.

Jim
 
allenb
I've been curious as to how much error occurs when there isn't a compensation for ambient at the cold junction.

For example if I were sensing a 400 F BT and used an uncompensated signal and my ambient was 68 degrees, how many degrees of error should I have? I was thinking if it was 1 degree or less we could dispense with the on-board chip sensor.

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
farmroast
I'm getting a nice RoR graph with my TC4 3.00
The was an Ethiopian roast for espresso with an extended finish
Some of the small ups and downs are due to line voltage fluctuations.
farmroast attached the following image:
ethiopia043011.jpg

Edited by farmroast on 05/06/2011 2:10 PM
Ed B.
DreamRoast 1kg roaster, Levers, Hand Mills http://coffee-roa...gspot.com/
 
JimG

Quote

allenb wrote:
I've been curious as to how much error occurs when there isn't a compensation for ambient at the cold junction.

For example if I were sensing a 400 F BT and used an uncompensated signal and my ambient was 68 degrees, how many degrees of error should I have? I was thinking if it was 1 degree or less we could dispense with the on-board chip sensor.

If you eliminate the ambient sensor, then you will be measuring the temperature difference between the hot end and the cold end of the TC.

So you'd use an assumed cold end temperature, then add the reading from the TC to that assumed cold end temperature.

The error's almost exactly equal to the difference between the assumed cold end temperature and the real cold end temperature.

If you want to maintain accuracy, and get rid of the ambient sensor, all you've got to do is keep an ice bath next to the roaster and connect the TC wires to some copper wires down in the ice bath Grin

Jim
 
allenb

Quote

JimG wrote:

If you want to maintain accuracy, and get rid of the ambient sensor, all you've got to do is keep an ice bath next to the roaster and connect the TC wires to some copper wires down in the ice bath Grin

Jim


Ok, I guess we stick with the ambient sensor. The ice bath would be ok as long as we were keeping some beers cold near the roaster.ThumbsUp
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
greencardigan
Bhante, I'm using continuous mode and 1 read per second.
Edited by greencardigan on 05/06/2011 6:45 PM
 
JimG

Quote

greencardigan wrote:
Bhante, I'm using continuous mode and 1 read per second.


Is there an advantage to continuous mode if you are "channel hopping"?

I can't tell for sure from reading the datasheet.

But it looks to me like each time you send the ADC a command to change channels, a conversion is started fresh on that new channel. So you're going to have to wait until that conversion is done before you can read it, whether in continuous or single shot mode.

It looks like continuous mode is only a real benefit when you are repeatedly reading the same channel.

What do you other guys think?

Jim
 
greencardigan
My main code loop does the following.

Read ambient
Read ADC ch1
Set ADC to ch2
Wait for conversion 70 ms
Read ADC ch2
Set ADC to ch1
Wait for remainder of 1 second
Loop

But I think you're right. Each time you switch channels it needs to start a new conversion. I probably doesn't matter which method you use. Continuous mode might have slightly simpler code? I think they default to continuous mode at power on.

Edit:
Just looking at aBourbon again and it looks like you are reading the ambient temps for each TC channel. Is that necessary? I use the one ambient reading for both cold junction compensations.
Edited by greencardigan on 05/07/2011 1:19 AM
 
greencardigan
I have a quick question regarding the PWM control in Catuai and Kona.

It looks like the Arduino can run slow PWM (1Hz) in the background. Can someone confirm this?
 
JimG

Quote

greencardigan wrote:It looks like the Arduino can run slow PWM (1Hz) in the background. Can someone confirm this?

The AVR chip has 3 timers. The Arduino code initializes all 3 to provide PWM at 490Hz, by default.

To get the slower time base needed for zero cross SSR's, the TC4 project's PWM16 library reprograms one of the AVR's 16-bit timers (timer1) and sets it up to provide a range of PWM time bases from 4 seconds to 128Hz.

The PWM16 library leaves timer0 alone because the Arduino time functions (millis(), delay(), etc) use timer0.

Jim
 
JimG

Quote

greencardigan wrote:
Just looking at aBourbon again and it looks like you are reading the ambient temps for each TC channel. Is that necessary? I use the one ambient reading for both cold junction compensations.

No good reason. But since it is a parallel operation, I didn't see any reason not to. And I didn't want it to feel left out B)

While we are on the subject ....

I tried to write the aBourbon code snippet (used in some other places, too) so that the timestamp for each ADC read is as close as possible to the time when the sample was actually taken. That played a big part in my thinking to use single shot mode with the ADC.

For PID applications, conventional wisdom says that the algorithm (mostly the derivative term, I think??) operates much better when you have good estimates for the sample intervals.

Jim
Edited by JimG on 05/07/2011 9:23 AM
 
Bhante

Quote

JimG wrote:If you want to maintain accuracy, and get rid of the ambient sensor, all you've got to do is keep an ice bath next to the roaster and connect the TC wires to some copper wires down in the ice bath Grin

And don't forget to put the ADC in the ice bath with it! Otherwise the copper wires from the TC to the ADV form another thermocouple, with opposite voltage, therefore your indicated temperature will be several tens of degrees out. That will make a nice 3-junction thermocouple!
 
allenb
OK OK, I got it. I'm going to the dollar store today to pick up two small ice chests!B)
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
JimG

Quote

Bhante wrote:And don't forget to put the ADC in the ice bath with it! Otherwise the copper wires from the TC to the ADV form another thermocouple, with opposite voltage, therefore your indicated temperature will be several tens of degrees out. That will make a nice 3-junction thermocouple!

As long as the copper wire connected to both the + and - TC leads is the same stuff, the error is really, really small. That's why we can safely measure the temperature at the wire terminals of the TC4 and ignore any Seebeck effect along the copper traces in the PCB.

Drowning the junctions from TC to copper in an ice bath is a very accurate way to measure absolute temperatures with thermocouples. But unless allenb already has the ice bath there for his beer, I do not recommend anyone go to this much trouble :(

Jim
 
Bhante

Quote

JimG wrote:As long as the copper wire connected to both the + and - TC leads is the same stuff, the error is really, really small. That's why we can safely measure the temperature at the wire terminals of the TC4 and ignore any Seebeck effect along the copper traces in the PCB.


If the cold junctions of the K-type thermocouple are in the ice bath, then the hot junction of the K-type thermocouple will induce at the cold junctions an EMF that corresponds exactly to the temperature of the hot junction. However if, in order to measure that emf, we connect copper wires from the cold junction in the ice bath to an ADC at, say, 68 Fahrenheit, then we have introduced two extra thermocouples into the system (one chromel-copper thermocouple and one alumel-copper thermocouple), each of which generates their own emf, and the ADC will simply measure the sum of the three. The error will not be tiny by any means! Between the chromel-copper junction and the ADC there is a significant temperature gradient of about 68 F, and that will generate a significant emf, not small by any means. Between the alumel-copper junction and the ADC there will be a temperature gradient of about 68 F, which will generate its own emf, different to the chromel-copper emf. The difference between the two will result in a false temperature reading.


Perhaps it is useful to remind ourselves at this point of the three laws of thermocouples (source: Wikipedia):

Law of homogeneous material: A thermoelectric current cannot be sustained in a circuit of a single homogeneous material by the application of heat alone, regardless of how it might vary in cross section. In other words, temperature changes in the wiring between the input and output do not affect the output voltage, provided all wires are made of the same materials as the thermocouple. No current flows in the circuit made of a single metal by the application of heat alone.

Law of intermediate materials: The algebraic sum of the thermoelectric emfs in a circuit composed of any number of dissimilar materials is zero if all of the junctions are at a uniform temperature. So If a third metal is inserted in either wire and if the two new junctions are at the same temperature, there will be no net voltage generated by the new metal.

Law of successive or intermediate temperatures: If two dissimilar homogeneous materials produce thermal emf1 when the junctions are at T1 and T2 and produce thermal emf2 when the junctions are at T2 and T3, the emf generated when the junctions are at T1 and T3 will be emf1 + emf2, provided T1<T2<T3.

In practice for the TC4 if we want to connect the thermocouples to the TC4 using connectorsthe mating connectors on the TC4 side should be connected to the TC4 using type K thermocouple wire, with the correct polarity. If we use copper wire from the connector to the TC4 any temperature gradient between the connector and the TC4 will cause a temperature error (eg if the TC4 is in a box, and one side of the box gets warmed due to proximity to the roaster). There was some confusion on this matter in the original TC4 thread.

On the other hand if the connectors are made of copper and the wires from the connector to the TC4 are type K with the correct polarity, the error will be very small by comparison (zero if the junctions across the connector are exactly at the same temperatures). Most important is that the wires are of the correct type.

Bhante
 
greencardigan

Quote

JimG wrote:
For PID applications, conventional wisdom says that the algorithm (mostly the derivative term, I think??) operates much better when you have good estimates for the sample intervals.

Isn't it the integral term that usually makes up most of the PID equation. That's the conclusion I came to after thinking about this over the last few weeks.
 
JimG

Quote

greencardigan wrote:
Isn't it the integral term that usually makes up most of the PID equation. That's the conclusion I came to after thinking about this over the last few weeks.

Eventually, P and D become almost zero, while the integral term converges to the fraction of heater power that equals the steady state heat loss. On my Silvia, this is around 8%, or 60 watts.

After a disturbance like pulling a shot the proportional and derivative terms will saturate the PID output. So it really depends on the conditions.

Jim
 
JimG
Bhante -

If the chromel/copper and alumel/copper junctions at the cold end are isothermal, then the error is due only to whatever tiny EMFs are generated by alloy imperfections in the copper leads.

Jim
 
Bhante

Quote

Bhante wrote: ... babble ... babble ... babble ...


Oops! As I was already starting to realise over the weekend, with the cold junctions in the ice bath the copper wires do indeed cancel out, under the law of intermediate metals and the law of successive temperatures.

My apologies!
Bhante
 
bvwelch

Quote

Bhante wrote:
[Oops! As I was already starting to realise over the weekend, with the cold junctions in the ice bath the copper wires do indeed cancel out, under the law of intermediate metals and the law of successive temperatures.
Bhante


Welcome to the club - my intuition gets me into all sorts of trouble. I do much better if I build it and test it instead. :-)

bvwelch.com/roast/tc03.jpg

It is best if you use TC wire from the TC4 screws to your front panel TC jacks.


Which came first -- the thermocouple phenomenon or these laws? This calls for more coffee. :-)
Edited by bvwelch on 05/09/2011 10:22 AM
 
farmroast
Bill had recommended to me that I match my probe wire, connectors and feed line to the TC4 and just use a lighter gauge from the female panel connector to the TC4. Made sense and worked for me.
Ed B.
DreamRoast 1kg roaster, Levers, Hand Mills http://coffee-roa...gspot.com/
 
JimG

Quote

farmroast wrote:
Bill had recommended to me that I match my probe wire, connectors and feed line to the TC4 and just use a lighter gauge from the female panel connector to the TC4. Made sense and worked for me.

Good advice. Best results if we use TC wire all the way from the tip of the sensor to the PCB wire terminals.

Jim
 
greencardigan

Quote

JimG wrote:

Quote

farmroast wrote:
Bill had recommended to me that I match my probe wire, connectors and feed line to the TC4 and just use a lighter gauge from the female panel connector to the TC4. Made sense and worked for me.

Good advice. Best results if we use TC wire all the way from the tip of the sensor to the PCB wire terminals.

Jim

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

Could I chop up an old Thermocouple and use that wire?
 
farmroast

Quote

greencardigan wrote:

Could I chop up an old Thermocouple and use that wire?

That's what I did. Just match the metals when connecting
Edited by farmroast on 05/09/2011 6:56 PM
Ed B.
DreamRoast 1kg roaster, Levers, Hand Mills http://coffee-roa...gspot.com/
 
Jump to Forum:

Similar Threads

Thread Forum Replies Last Post
Heating Issues with Nesco Pro Other Roasters 5 04/22/2021 1:51 PM
Repeatability Issues Due to Chaff Combustion During Roasting?? HotTop Roaster 5 01/01/2019 2:14 AM
TC4/Artisan Temp Read Issues Dataloggers/Controllers/Rate of Rise Meters 16 01/04/2018 12:03 AM
Lack of airflow or stale beans (or other issues)? Kaldi roaster troubleshooting. Roasting Coffee 21 03/20/2017 9:04 AM
Fluid-o-Tech Vibrator Pumps Equipment re-builds, reviews, fix it's and more 2 05/28/2016 8:18 AM
Homeroasters Association Logo, and all Content, Images, and Icons © 2005-2016 Homeroasters Association - Logos are the property of their respective owners.
Powered by PHP-Fusion Copyright © 2022 PHP-Fusion Inc
Released as free software without warranties under GNU Affero GPL v3
Designed with by NetriX