Author Topic: Roasting With Gas Formula for a profiler?  (Read 2733 times)

Offline Monito

  • Distributor
  • *****
  • Posts: 1081
  • I have 4 coffee Roasters and I don't collect them!
Roasting With Gas Formula for a profiler?
« on: October 15, 2017, 06:03:13 AM »
Hello Family,

Can someone help getting my gas roaster profiler working.

I meed a formula that would keep temperature steady from 300-390 degrees in certain amount of time using gas as input and reacting to temperature as output.

I am good at writting software, working with hardware, but I have no clue about thermodynamics. My simple delta temperature overtime won't cut it.

I use 100% C code with WAGO modules to handle the hardware using a Rpi using Linux.

Thanks

Monito
« Last Edit: October 15, 2017, 06:10:59 AM by Monito »

Offline Ascholten

  • Administrator
  • *****
  • Posts: 11739
  • Artisian 6 and Behmor
Re: Roasting With Gas Formula for a profiler?
« Reply #1 on: October 15, 2017, 07:36:00 AM »
Can't you just use a standard PID controller?  Throttling might be a bit of a pain but if you have a pilot light, a simple solenoid on / off should suffice.  Unless you are roasting in a closed area that is pretty much the same temperature every time, any formula you may come up with, is going to deviate as the outside surroundings change.  There is no one size fits all, hence the PID, you can tweak the inputs to throttle the ramp based on past history or what's expected etc etc.  Worse case, bring it up slow, slow is easier to control, then throw the gas to it when you need it.

Aaron
As I have grown older, I have learned that pleasing everybody is impossible, but pissing everybody off is a piece of cake!

Offline Monito

  • Distributor
  • *****
  • Posts: 1081
  • I have 4 coffee Roasters and I don't collect them!
Re: Roasting With Gas Formula for a profiler?
« Reply #2 on: October 15, 2017, 11:29:49 AM »
I want to have full control, it already have a PID.

Thanks

Monito

Offline Ascholten

  • Administrator
  • *****
  • Posts: 11739
  • Artisian 6 and Behmor
Re: Roasting With Gas Formula for a profiler?
« Reply #3 on: October 15, 2017, 11:48:05 AM »
If you already have a PID then I can not provide you a forumula, you will have to do that yourself by how your roaster works.  That would be like saying tell me how to drive my car on the freeway in rush hour.  Until you actually DO it and see the variables involved you can't just plug something in.  How fast does your roaster shoot up, how much did you over shoot, is your I too big and you are oscillating?.. You will need to tune it to fit your specific roaster.  That's not something one can really walk you through without seeing at the minimum your initial settings and what it did with them.

Many of the newer PID's are self learning, you can tell it I want this and that and they will learn after a few runs and tweak their own settings to match best profile.  Either that or get a PLC, siemens comes to mind, an older SLC500 and Ladder Logic will work too.    This definitely is not really plug and play here.

Aaron
As I have grown older, I have learned that pleasing everybody is impossible, but pissing everybody off is a piece of cake!

Offline Monito

  • Distributor
  • *****
  • Posts: 1081
  • I have 4 coffee Roasters and I don't collect them!
Re: Roasting With Gas Formula for a profiler?
« Reply #4 on: October 15, 2017, 12:06:52 PM »
Th PID all it does it cuts gas when there is an emergency. It also have sound alarms. That is all its used for. 

I never said it was going to be plug and play. The electric one that I already have tooke me 5 years to tweek it right

Monito
« Last Edit: October 15, 2017, 01:35:50 PM by Monito »

Offline 9Sbeans

  • Standard User
  • *
  • Posts: 73
Re: Roasting With Gas Formula for a profiler?
« Reply #5 on: October 16, 2017, 10:49:24 AM »
I’ve been thinking of the same question for years.

My solid drum gas roaster comes with PID controller for its simple on/off solenoid gas valve, and the bean temperature thermocouple reads the signal for feedback control. It should be noted that the PID parameters are best suitable for holding up a stable temperature. During a roast, the bean temperature is variable and by definition tweaking a roast profile is intrinsically incompatible with a PID.

There is workaround, and you don’t need to reinvent the wheel.

In the popular roasting software Artisan, it can directly communicate with the PID controller on the roaster in MODBUS mode. If you set the PID controller in slave mode, you can effectively use Artisan as the master, and have Artisan looking up a new set of PID parameter table. The simple on/off gas valve should be upgraded to proportional solenoid valve, and voila you have a full-auto gas roaster.  :P

I've talked to the person who designed my roaster, and he might have been working on this for a while. To accommodate the environmental variable (e.g. room temperature, bean moisture content, etc.), the adjustment of the gas/airflow should be in small increment and I have accumulated nearly a thousand profiles on my sample roasting machine. In theory I can construct the PID parameter table on my machine.

Just my random thoughts.  ;D

Offline Monito

  • Distributor
  • *****
  • Posts: 1081
  • I have 4 coffee Roasters and I don't collect them!
Re: Roasting With Gas Formula for a profiler?
« Reply #6 on: October 16, 2017, 01:38:39 PM »
I’ve been thinking of the same question for years.

My solid drum gas roaster comes with PID controller for its simple on/off solenoid gas valve, and the bean temperature thermocouple reads the signal for feedback control. It should be noted that the PID parameters are best suitable for holding up a stable temperature. During a roast, the bean temperature is variable and by definition tweaking a roast profile is intrinsically incompatible with a PID.

There is workaround, and you don’t need to reinvent the wheel.

In the popular roasting software Artisan, it can directly communicate with the PID controller on the roaster in MODBUS mode. If you set the PID controller in slave mode, you can effectively use Artisan as the master, and have Artisan looking up a new set of PID parameter table. The simple on/off gas valve should be upgraded to proportional solenoid valve, and voila you have a full-auto gas roaster.  :P

I've talked to the person who designed my roaster, and he might have been working on this for a while. To accommodate the environmental variable (e.g. room temperature, bean moisture content, etc.), the adjustment of the gas/airflow should be in small increment and I have accumulated nearly a thousand profiles on my sample roasting machine. In theory I can construct the PID parameter table on my machine.

Just my random thoughts.  ;D
The drivers for the Watlow I use is Windows, so I cannot use it.

I want to control it so I can use several different profiles depending on the bean. I currently do this on my electric roaster, but gas is a different beast. I wanted a formula instead of tables. 
I have a simple program (test driver), but the sucker always over-shuts. Then I realize that I need to check on the Delta Temp in a specific period and use it as well.

Something like this is the original, but it needs a LOT of work:

Code: [Select]

  for(;;) {

    current_time = time(NULL);

    if (temperature_0 > 300.0) {
      //15 degrees to get 390 in 6 minutes
      delta_temperature = (temperature_0 - saved_temperature)/15.0;
      if (saved_time < current_time) {
        if (delta_temperature > 1.0) {
          gas = gas * 0.80;  //lower its going too fast
        } else if (delta_temperature < 1.0) {
          gas = gas * 1.20; //Increase gas its going to slow
        saved_time = time(NULL) + 10.0; //check every 10 sec
        saved_temperature = temperature_0;
        printf("*************temperature_0 = %.2f, delta_temperature = %.2f, gas = %.2f\n", temperature_0, delta_temperature, gas);
      }
    }
   ...

Monito

Offline 9Sbeans

  • Standard User
  • *
  • Posts: 73
Re: Roasting With Gas Formula for a profiler?
« Reply #7 on: October 16, 2017, 02:41:24 PM »
I run Artisan on Windows 7. Highly recommended, just give it a try.
There is no universal formula, but I have some general rules.

I’d take one of my roast profiles from last night as an example. To describe a roast profile, we generally need the time of Dry (4:01), the time of Maillard reaction (MAI, hat tip to Rob Hoos; 3:45), the time after the first crack starts (2:00), and the temperature raised after the first crack starts (17.0*F). I want to alter the length of each time segment to modulate the flavor.

The length of Dry (4:01) is largely determined by the bean mass (227.0g), charge BT (337.7*F), and the small increment of the %gas (Power increased from 7% to 16%, 20%, eventually to 44% at the end of Dry). You may try to use one gas formula to define the Dry phase on your machine.

The length of Maillard Reaction (3:45) is determined by the bean mass and the %gas (40~44%) while entering the second phase. The gas is tapered off in this phase, to properly set up the finishing phase. If I charge the drum too hot, too long during the MAI, I would have runaway BT in the Finishing. Similarly, I also avoid too cold of drum which would stall the roast. I keep an eye on the Exhaust Temperature (ET) probe to gauge the drum during the MAI phase.

Once the first crack starts, the roast enters the Finishing phase. I have common combinations of %Gas and %Airflow in this phase. The ambient temperature and humidity may introduce variations in the timing of the adjustment. Once the roast hits my desired time and temperature, I drop the bean. Of cause I might prefer darker roast for certain origins and lighter roast for certain brewing methods.

Now you want a unified formula….  8)

Offline mp

  • Standard User
  • *****
  • Posts: 16800
  • Nothing like a nice shot!
Re: Roasting With Gas Formula for a profiler?
« Reply #8 on: October 16, 2017, 06:17:33 PM »
Hmm ... way too scientific for me for brewing coffee.

 :o
1-Cnter, 2-Bean, 3-Skin, 4-Parchmnt, 5-Pect, 6-Pu
lp, 7-Ski

Offline stevea

  • Standard User
  • **
  • Posts: 215
Re: Roasting With Gas Formula for a profiler?
« Reply #9 on: November 07, 2017, 10:32:03 PM »
Well the core bit of thermodymics you need is:
(Heat Capacity) * (Rise in Temperature)= (Heat Energy Supplied)
but it's very unlikely to be helpful in modeling the roast.

In most materials heat capacity (Cx) is vaguely constant over a range of temps, except when it isn't.

For example the heat capacity of water varies between ~4.2 to 4.5 kJ/kg.C [iow 4.2 to 4.5 kJoule(100 watts for 42 to 45 seconds) will raise the temp of 1 liter of water by 1C(1.8F) degree.   However the phase change from liquid to gas at 100C [heat of vaporization] will cost you 2260 kJ/kg. IOW it costs less than 1/5th the amount of energy to heat cold water to the edge of a boil, as to boil it.  FWIW water is likely to have the highests specific heat capacity and heat of vaporization of anything in a coffee bean, but it only makes up a small fraction of the mass.

The beans themselves undergo a number of endothermic chemical reactions (like Maillard, tho' it's tiny energetically) and then of course the major exothermic event into 2nd crack.   The endo's consume heat energy w/o raising temps,and the exo's produce heat energy and raise temps.

Roasting chambers - glass & metal, act pretty nicely, w/ roughly constant heat capacity.

Then there is the application of heat to the chamber ... the burner flame visible edge is the hottest region and you'd like that just touching the metal plate, then heat is conducted [note that commonly used stainless is a pretty awful heat conductor].


Then you have system losses.  In a non-convective (not-moving) media you'd just have conduction that you could model linearly, but in the real world your roaster is sitting in a sea of ambient air, and that air rises convects well near a heated surface.  NIST has some papers on calculating this extra convection loss from some common geometric shapes, but these are all dependent on the geometric factors (tall hot vertical walls are the worst) and very dependent on the temperature diff.

---

Take-away - it's a complex load that you are driving, with a lot of variability based on parameters like bean moisture and ambient air temp and humidity, and tho' it's useful to get some ballpark numbers for calculating power reqs, your only real hope of controlling bean temp (the output variable) is with a dynamic control scheme. Most of the energy is used to heat the roasting chamber & has losses - which are actually simpler to model.

Aaron is right that most modern PIDs have built-in "tuning" (IIRC it was the Nichols algorithm that was the early  approach here) but technically these algorithms can only handle linear controls.  Despite that, it's likely that the non-linearity of the system is still manageable.

You can certainly find C code to act as PID in the rPi, and I suspect someone has the tuning algorithms in C as well.

--
Coffee beans have a density *around*
green beans      0.649 kg/l
roast beans      0.325 kg/l

And roasting to a medium level requires the application of about 582 kJ/kg of greens [from Coffee Technology Sivetz et al]
--

The other bugaboo I have wrt control is that no one can measure bean temperature !   What does it even mean ?  The interior bean temp ?  The exterior surface bean temp ?  The average ?  Most ppl glue a thermocouple in place and measure the roasting chamber temp - or chamber air temp which isn't very close.   I think the best practical approach is to measure bean surface temps with an IR temp sensor.  Use that as the control variable for the PID.




« Last Edit: November 08, 2017, 09:09:49 AM by stevea »
"Never put off until tomorrow what you can do the day after tomorrow."  — Mark Twain

Offline Monito

  • Distributor
  • *****
  • Posts: 1081
  • I have 4 coffee Roasters and I don't collect them!
Re: Roasting With Gas Formula for a profiler?
« Reply #10 on: November 08, 2017, 04:41:27 AM »
Very instructive, for now I will use tables. But will try to come up with something.

Thanks

Pat