Who is here? 2 guest(s)
 Print Thread
My first popcorn mod roaster (vahegan)
vahegan
Hi!
This is my first roaster. I am completely new to this forum and this is my very first post. I designed this roaster from the scratch, without any previous knowledge or experience, and much before I found out about this forum. Therefore, please be forgiving about my wrongdoings.

I decided to start home roasting in January, and a popcorn machine seemed easiest to me, so I purchased one. It was called Korny, a 1200W model by Italian company Ardes.

s10.postimg.org/6cuq8ywnt/Ardes_Korny.jpg

I tried a couple of roasts - the results were better than store bought stale coffee, but I was disappointed by the too quick roasts it gave me. My original roast times were between around 3:30 to 4 minutes, and just a 10-20 seconds difference in roast times made a huge difference in roasting - from just after first crack to completely black-burnt oily beans.

So I assumed that 1.2kW was somewhat excessive for 85-90g of coffee and I started to think about modifications.

I started with adding a thermocouple:

s14.postimg.org/ijbbe1a6p/01_Thermocouple.jpg

I disassembled the popcorn machine, took out the aluminum barrel, drilled a hole in the bottom center, inserted the thermocouple and affixed with a nut:

s13.postimg.org/5wfb6g3k7/06_Thermocouple_installed_top.jpg

I then drilled a hole in the insulator on which the heater coils are attached and pushed the thermocouple wire through it:

s15.postimg.org/j4bsst8nf/09_Hole_in_heater.jpg

I drilled another hole for the thermocouple in the metal flank of the heater unit. Here is the whole stuff assembled back:

s12.postimg.org/nnvsw5te5/10_Hole_heater_side.jpg

Then I purchased a thermocouple-to-digital chip (MAX6675) and connected it to an Arduino Nano. To control heater power, I also connected to Arduino a triac (BTA26-600), controlled to switch with a zero-cross detector (MOC3063). Next, I had to do something to provide power to the blower and the Arduino. The blower motor was initially supplied from a section of the heater, which I assumed was not appropriate for my project since I was going to control heater power. I needed a power supply, powerful enough for the motor. According to my measurements, the motor consumed about 2.5A at its rated 24V, which is about 60W. So I needed a power supply capable of some 70-75W, but small enough to fit in the empty space in the popcorn machine case. I first thought about using an electronic transformer for halogen bulbs. They are rated for 12V output, so I added up some turns on the transformer and added a rectifier bridge with ultra-fast diodes. Initially, it seemed to be a perfect solution for me (especially since 100W electronic transformers were available for just under $4). At first, all worked fine. However the schematic of these electronic transformers is not designed for operation with no load. It worked well when the motor was running, but as soon as I turned it OFF, transistors quickly overheated and broke down. After blowing quite a few units, I finally decided to use its switching transformer, but replaced the circuit by a half-bridge driver (IR2153) and two FETs (IRF840). The resulting power supply was about the size of a match box, was powerful enough and fitted in the case of the popcorn machine. I wound yet another winding, with good filters, to supply the Arduino.

I connected a power transistor (TIP122) to one of Arduino's PWM outputs to control the blower speed. I assembled all this stuff on a prototyping board and attached it on the popcorn machine bottom:

s30.postimg.org/gbxbrwtk1/11_Proto_board.jpg

s13.postimg.org/oc5akc4xz/12_Circuit.jpg

Since I've got quite a few free pins on the Arduino, I added a Nokia 5110 graphics LCD screen and an RGB LED for indication, and two buttons for control. The present roaster assembly looks like this:

s23.postimg.org/qfmoziu23/13_Roaster.jpg

Then I worked on the software. I used a PID library to control heater power, and added several roast profiles. To start with, I just copied the iRoast 3-stage profiles that I found somewhere on Sweet Marias forum. I assume that there is some difference in temperature readings of iRoast and what my thermocouple is giving: when I use iRoast's standard settings (even when using the real figures of its temperature sensor rather than setting values), i.e. 227C for 390 seconds, then 202C for 180 seconds, and again 227C for 90 seconds, I get dark and oily roasts. I am getting much better results with a profile which the author describes as "too light for most people's taste ": 152C for 120 seconds, 179C for 180 seconds, 213C for 270 seconds. Well, maybe I am also a fan of lighter roasts...

All this design and development at my spare time took me more than a month. By the time, I didn't know about the Artisan software, otherwise I would have thought of some output in a compatible format. I am now considering this, along with switching to slower heating in 5 stages, rather than the present 3 stages - hopefully this will make the results closer to drum roasting.

For the time being, my software just sends the time stamps and thermocouple readings to the serial port, which I log and then plot roasting graphs in Excel:

s18.postimg.org/xk1nvda6x/Screenshot_2014_03_23_16_58_54.png

The blue graph is the actual temperature measured with the thermocouple, the red is the temperature setting (there is an overshoot at the beginning of the first stage in this graph, which I already mostly fixed by PID adjustments, but I couldn't find more recent graphs on my computer). The green line is the power that PID algorithm applies to the heater. (I am using a constant fan speed during the whole roast process and increase it by 20% at the cooling stage, just after turning OFF the heater).

A sample roast using this profile:

s21.postimg.org/cqgi9wrwn/14_Roasted_coffee.jpg

Well, this much for now. I will shoot a video and upload it later.
I would greatly appreciate your comments and suggestions towards improving this machine.
 
oldgearhead
Awesome job! Very nice! My only suggestion would be to be more aggressive in stage two (ramp-to-first crack) and less aggressive in the drying and finish stages. However, the drying phase is somewhat dependent on the ambient temperature and if you use a 'warm up' or not. But any fluid-bed roaster is at the mercy of the blower speed at all times during the roast. Usually more air will lower the 'batch' (BMT) temperature and less air will increase it. Therefore, even though you are not changing the speed of your blower, the 'batch' will cool because the beans get lighter during the roast. So maybe your current 'program' is perfect...
Edited by oldgearhead on 03/23/2014 9:35 AM
 
vahegan
Thank you, oldgearhead
Can you please explain what do you mean by being aggressive between Mayard phase and the first crack? Do you mean higher temperature or faster change of temperature?

Quote

However, the drying phase is somewhat dependent on the ambient temperature and if you use a 'warm up' or not.

Again, not quite clear to me what do you mean? Since I am using a temperature controller, the drying phase temperature does not depend on the ambient, after the initial overshoot, its stable. I think only the steepness of the heating cure somewhat depends on the ambient temp.

As for the blower speed - yes, I can control it, but a two-variable PID is rather complicated and I am not quite good at PID tuning, therefore I leave it constant for the time being.
My DIY roaster thread
My work-in-progress roaster project
 
vahegan
Update: I have just uploaded a video of my roaster in operation (a full cycle) to youtube:
[video]http://www.youtube.com/watch?v=_EibeHFTing[/video]
My DIY roaster thread
My work-in-progress roaster project
 
Airhan
Nice video, you did some great work on that popper, and impressive use of the arduino!
Aaron
"Grind it like it did you some great injustice!"D.L.Clark
 
allenb
Amazing work on your popper! You seem to have an excellent grasp of electronics and microcontrollers which is a real plus when trying to create your own controls for a roaster.

A couple of thoughts.

Roasting in stages (power level stages) works pretty well in drum roasters with their inherent thermal inertia but roasting in stages with a fluidbed roaster is not advisable unless you use enough stages to prevent stalls in bean temperature rate of rise. For proper development we want the coffee to always see a rise in temperature and never see a flat line (stall).

On drying, browning and finish phases of a roast, try as many variations of the 4-4-4 as you can to see what gives you the best cupping for each type of coffee you purchase. After experimenting with fast, medium and slow profiles I've come to the conclusion that there are no rules that can't be broken when it comes to coffee roasting. You have to be willing to try many variations to find the sweet spots with any coffee.

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
alexcampbell
The fall in temperature can be fixed with further tuning the PID settings. My arduino controlled Poppery 1 does not have that dip in the profile. I am at P: 1.79 I:0.09 D: 8.99. I am using the built in Roastlogger PID.
Would you be willing to share your code?
 
JETROASTER
Nicely done!! Welcome to HRO.
-Scott
 
oldgearhead

Quote

vahegan wrote:

Thank you, oldgearhead
Can you please explain what do you mean by being aggressive between Mayard phase and the first crack? Do you mean higher temperature or faster change of temperature?

Quote

However, the drying phase is somewhat dependent on the ambient temperature and if you use a 'warm up' or not.

Again, not quite clear to me what do you mean? Since I am using a temperature controller, the drying phase temperature does not depend on the ambient, after the initial overshoot, its stable. I think only the steepness of the heating cure somewhat depends on the ambient temp.

As for the blower speed - yes, I can control it, but a two-variable PID is rather complicated and I am not quite good at PID tuning, therefore I leave it constant for the time being.


Again excellent job!
First let me say I use no automation on my coffee roaster. However, when I see a super job like yours, I am tempted to take the old A/B SLC504 off the shelf and start in.

I'll start by discussing two of the critical fluid-bed coffee roaster temperatures: Bean Mass Temperature (BMT) and Process Variable Temperature (PVT). BMT is the temperature of the beans and the hot air that keeps them moving. PVT is the temperature of the hot air that enters the RC (roasting chamber). If no change is made in blower pressure during the roast as the beans get lighter the BMT probe will be influenced more by the PVT than the BT (bean temp). For two years I always adjusted the PVT during each roast, but recently I have just set a constant PVT temperature, and adjusted the blower pressure about four times during the roast to control the BMT.

Answers:
1) "More aggressive' - I mean a quicker RoR (rate of rise of the PVT).
2) 'Ambient temperature' - My roaster lives in an unheated garage in Central Indiana. When the garage is 50F I use no warm-up or reclaim air baffles. But when its 17?F I must use the baffles plus a warm-up to have the same roast time for the same bean.

One more tip - Try to cool your beans faster with an external cooler.

Great job! Great job!
oldgearhead attached the following image:
bmt_1_7.jpg

Edited by oldgearhead on 03/25/2014 9:20 AM
 
vahegan

Quote

Airhan wrote:
Nice video, you did some great work on that popper, and impressive use of the arduino!


Quote

freshbeans wrote:
Nicely done!! Welcome to HRO.
-Scott


Quote

allenb wrote:
Amazing work on your popper! You seem to have an excellent grasp of electronics and microcontrollers which is a real plus when trying to create your own controls for a roaster.


Quote

oldgearhead wrote:
Again excellent job!


Thank you, all, guys, for the nice words! Your encouragement is important for continuing the work!

Quote

allenb wrote:
Roasting in stages (power level stages) works pretty well in drum roasters with their inherent thermal inertia but roasting in stages with a fluidbed roaster is not advisable unless you use enough stages to prevent stalls in bean temperature rate of rise. For proper development we want the coffee to always see a rise in temperature and never see a flat line (stall).

Thank you for the input, Allen,
I am trying to understand what you mean.
What do you mean when you say "Roasting in power level stages"? My stages are based on my attempts to stabilize the temperature at certain stages, and the PID controller varies the power to maintain the temperature stable. The power is the green line on my screenshot, and you can see the variations: its not at all stable, while the temperature graph (blue) is attempting to stay close to the temperature setting.
So, by using PID, I think I'll be able to program a slow ramp of temperature, similar to a drum roaster, if that is required.
I was also not able to grasp the idea of why do we need to keep the temperature rising all the time, and never stall? I think I am missing something important here, can you please offer some more explanation on this point, or direct me to some reading on the matter? So far, I thought that stable temperature during roast stages was the key to success, and have put quite some effort to achieve this.

Quote

On drying, browning and finish phases of a roast, try as many variations of the 4-4-4 as you can to see what gives you the best cupping for each type of coffee you purchase. After experimenting with fast, medium and slow profiles I've come to the conclusion that there are no rules that can't be broken when it comes to coffee roasting. You have to be willing to try many variations to find the sweet spots with any coffee

Again, my knowledge is yet insufficient to quickly grasp the meaning. What do you mean by "variations of the 4-4-4" - do you mean temperature settings, PID values, or roast stage durations? Yes, I like experimenting, and I am constantly doing that, but I lack experience. There are too many variables that can be adjusted, and I just feel confused without understanding what affects what. I roast in small batches (about 1/5 of a pond at a time) that are good for a few days of cupping, which is rather good for experimentation. However it is difficult to judge without objective criteria of roast results. I mean, there are, again, numerous parameters that affect my cupping experience (e.g. weather, quality of night sleep, mood, and air temperature in the house - to mention just a few) and the same batch is perceived very differently each time. I am a physicist by education and it'd be much easier for me to operate with measurable parameters, being able to calculate measurement mean error etc. Otherwise, it feels like wandering with closed eyes in a dark room that is full of obstacles and not...

Quote

alexcampbell wrote:
The fall in temperature can be fixed with further tuning the PID settings. My arduino controlled Poppery 1 does not have that dip in the profile. I am at P: 1.79 I:0.09 D: 8.99. I am using the built in Roastlogger PID.
Would you be willing to share your code?

Thank you, Alex. Certainly, there is much room to improve the PID control. I am presently at P:3 I:0.4 D: 0.1 but this was found by the method of trial and effort, without applying any consistent approach. Actually, I tried to determine the settings using the Cohen Coon Tuning Method from the ramp graph, but the results were not sensible (I was getting a P setting around 70).
How did you arrive at quoted coefficients? In doubt that same coefficients that you use will be applicable to my popper, this depends on numerous factors, including sampling frequency. In my current setup, I am sampling once a second. I tried to update the software to 4 samples per second, and the coefficients were absolutely wrong after the change (I couldn't easily find new PID coefficients and returned back to the old software revision).

I will post the code in a separate message.
My DIY roaster thread
My work-in-progress roaster project
 
vahegan
So, here's the Arduino code I have written for my popper.

/*
Arduino keys
0       Rx              -
1       Tx              -
2   Int, PWM   Kbd1
3   Int, PWM   Kbd2
4              KbdCommon
5   PWM           Fan
6   PWM           Triac
7              Reserved
8              Reserved
9   PWM           RED LED
10   PWM           GREEN LED
11   PWM           BLUE LED
12              LED common
13              LCD D/C
A0   AIN           LCD DN
A1   AIN           LCD CLK
A2   AIN           LCD RST
A3   AIN              Thermo CLK
A4   AIN, I2C SDA   Thermo CS
A5   AIN, I2C SCL   Thermo DO
A6      AIN             -
A7      AIN             Fan voltage

*/

#include "max6675.h"
#include <LCD5110_Graph.h>
#include <PID_v1.h>

#define HEATING 1
#define STAGE1 2
#define STAGE2 3
#define STAGE3 4
#define COOLING 5
#define START 10

double Setpoint, Input, Output;
float P, I, D, feedbackFactor;
PID myPID(&Input, &Output, &Setpoint,P,I,D, DIRECT);

// LCD5110 myGLCD(CLK,DN,DC,RST);
LCD5110 myGLCD(A1,A0,13,A2);
extern uint8_t SmallFont[];

#define OFF 0
#define ON 1

struct profile {          // Profile structure
  char *name;             // Profile name
  int  Stage1Temp;        // Temperature of Stage 1
  int  Stage1Time;        // Duration of Stage 1
  int  Stage2Temp;        // Temperature of Stage 1
  int  Stage2Time;        // Duration of Stage 1
  int  Stage3Temp;        // Temperature of Stage 1
  int  Stage3Time;        // Duration of Stage 1 
  byte HeaterPower;       // Initial heater power (%)
  byte HeatFanPower;      // Initial cooler power (0..150)
  byte CoolPower;         // Fan power (0..150) in cooling stage
  byte CoolTime;          // Time to cool the beans after roasting (seconds)
  byte FinalTemp;         // Final temperature after cooling
}; 

struct profile profiles[] = {                           // Array of all roast profiles
  {"  Preset #1   ",227,390,202,180,227,90, 100,100,120,120,45}, // iRoast Preset #1, total roast time: 11:30 min
  {"  Preset #2   ",227,300,202,300,227,90, 100,100,120,120,45}, // iRoast Preset #2, total roast time: 11:30 min - shorter stage 1 time, longer middle stage, otherwise the same as preset 1.
  {"City/City plus",152,120,182,180,214,270,100,100,120,120,45}, // The roast curve Sweet Maria uses for almost all samples to get a City or City plus roast (which is considered a cupping roast I know and is probably lighter than most folks like)
  {"Island Coffees",152,180,179,180,207,180,100,100,120,120,45}, // Coffees from Jamaica, Hawaii, and to a lesser degree Puerto Rico, have a lower bean density because these island coffees do not have the altitudes of such origins as Kenya. They benefit from a lower initial temperature during the warmup time. Here is the program I am currently using for a City roast:
  {"BrazilEspresso",152,180,213,180,218,240,100,100,120,120,45}, // Like the Island coffees, Brazils come from lower elevations. They benefit from a slower warmup and a longer overall roast. For Northern Italian Espresso I like this program, and you can use it for other light espresso roasts too:
  {" Test - Mest  ",50,5,60,10,70,15,100,100,120,10,45}          // test profile for debug
};

/*
struct profile profiles[] = {                           // Array of all roast profiles
  {"  Preset #1   ",252,390,227,180,252,90, 100,100,100,120}, // iRoast Preset #1, total roast time: 11:30 min
  {"  Preset #2   ",252,300,227,300,252,90, 100,100,100,120}, // iRoast Preset #2, total roast time: 11:30 min - shorter stage 1 time, longer middle stage, otherwise the same as preset 1.
  {"City/City plus",177,120,204,180,238,270,100,100,100,120}, // The roast curve Sweet Maria uses for almost all samples to get a City or City plus roast (which is considered a cupping roast I know and is probably lighter than most folks like)
  {"Island Coffees",177,180,204,180,232,180,100,100,100,120}, // Coffees from Jamaica, Hawaii, and to a lesser degree Puerto Rico, have a lower bean density because these island coffees do not have the altitudes of such origins as Kenya. They benefit from a lower initial temperature during the warmup time. Here is the program I am currently using for a City roast:
  {"BrazilEspresso",177,180,238,180,243,240,100,100,100,120}, // Like the Island coffees, Brazils come from lower elevations. They benefit from a slower warmup and a longer overall roast. For Northern Italian Espresso I like this program, and you can use it for other light espresso roasts too:
  {" Test - Mest  ",50,5,60,10,70,15,100,100,10,120}  // test profile for debug
};
*/

byte profile=0, nprofiles=5;
unsigned int setTemperature=0, setDuration=0, ProcessTime=0;

unsigned long TriacSwitch=0, Tstart=0, currentmillis=0, previousmillis=0; 
// TriacSwitch - the moment when triac switches ON or OFF
// Tstart - the moment when the key was pressed
unsigned int CoolerDuration=15; // HeaterDuration+CoolDuration

int seconds = 0; // number of seconds since button was pushed
int count=0; // loop cycles counter

unsigned int state = OFF;
boolean PIDenable = OFF; // flag, when ON, PIDenable constant temperature
volatile boolean key1int_guard = false ;
volatile boolean key2int_guard = false ;

// define pin connections
// #define TriacPin 6
const byte TriacPin = 6;
const byte FAN_PWM = 5;

const byte redLED = 11;
const byte greenLED = 10;
const byte blueLED = 9;
const byte LEDcommonPin = 12;

const byte keyboardPin = 4;
const byte key1InterruptPin = 3;
const byte key2InterruptPin = 2;

const byte key1Interrupt = 1;
const byte key2Interrupt = 0;

// thermocouple pins
const byte thermoDO = A5;
const byte thermoCS = A4;
const byte thermoCLK = A3;
int mintemp=0, maxtemp=300;

const byte FanVoltagePin = A7;
int FanVoltage=0;

// screen
byte yres=48;
byte xres=84;

byte currentTriacPower = 0, currentFanPower=0;
int ONcycles=0, OFFcycles=0;
boolean TriacState=OFF;
boolean Abort=0;
float currentTemperature = 0.3, Temperature=0;

MAX6675 thermocouple(thermoCLK, thermoCS, thermoDO);

void Triac() {
  unsigned long T=currentmillis-TriacSwitch;

  if (currentTriacPower>100) currentTriacPower=100;
  if (currentTriacPower<0) currentTriacPower=0;
 
  ONcycles=currentTriacPower*10;
  OFFcycles=1000-ONcycles;

  switch (TriacState){
      case OFF:
       if (T>=OFFcycles) {
          TriacState=ON;
          TriacSwitch=currentmillis;
       }
      break;
      case ON:
       if (T>=ONcycles) {
       TriacState=OFF;
       TriacSwitch=currentmillis;
       }
      break;
      }
  if (ONcycles==0) {TriacState=OFF;}
  if (OFFcycles==0) {TriacState=ON;} 
  LED(TriacState);
  digitalWrite(TriacPin, TriacState);
 
}

void setFanPower (int power) {
  if (power>255) power=255;
  if (power<0) power=0;
  analogWrite(FAN_PWM, power);
}

void toggle(int pinNum) {  // toggle the state on a pin

  int pinState = digitalRead(pinNum);
  pinState = !pinState;
  digitalWrite(pinNum, pinState);
}

void LED(boolean state){
  digitalWrite(LEDcommonPin, state);
}

void RGB(byte red, byte green, byte blue) {
  analogWrite(redLED, 255-red); 
  analogWrite(greenLED, 255-green); 
  analogWrite(blueLED, 255-blue); 
}

void key1pressed () {
  if (!key1int_guard) return;
  if (state==0) { 
  state = START;
  key1int_guard=false;
  key2int_guard=false;
  }
}

void key2pressed () {
  if (!key2int_guard)return;
  if (state==0) { 
  profile++;
  if (profile>nprofiles) profile=0;
  key2int_guard=false;
  } else state=OFF;
}

void MaintainTemperature() {
  Input=currentTemperature*feedbackFactor;
  Setpoint=setTemperature;
  myPID.Compute();
  currentTriacPower=Output/2.55;
}

void updateScreen(){
      int tmp1=floor(currentTemperature);
      int tmp2=floor(10*(currentTemperature-tmp1));
      String temp=String("Temp=")+tmp1+String(".")+tmp2+String("~C");
      myGLCD.clrScr();
      myGLCD.print("Coffee Roaster", CENTER, 0);
      myGLCD.invertText(true);
      myGLCD.print(profiles[profile].name, CENTER, 10);
      myGLCD.invertText(false);
      myGLCD.print(temp, CENTER, 20);
      temp=String("Time=")+seconds+String("s");
      if(state) myGLCD.print(temp, CENTER, 30);
      temp=String("Stage: ")+state;
      if(state) myGLCD.print(temp, CENTER, 40);
      myGLCD.update();     
      RGB(tmp1,25,25);
}

void sendSerial(){
      String temp=seconds+String("\t")+(int)currentTemperature+String("\t")+setTemperature+String("\t")+currentFanPower+String("\t")+currentTriacPower;
      Serial.println(temp);
}

void updateTime_and_Temp(){
    currentmillis=millis();
    if(currentmillis-previousmillis>1000){
      previousmillis=currentmillis;
      currentTemperature=thermocouple.readCelsius();
      updateScreen();
      if (state) {
        seconds++;
        sendSerial();
      } else key2int_guard=true;
      if (PIDenable) MaintainTemperature();
    }
}

void setup() {
  Serial.begin(9600);
// initialize the keyboard 
  pinMode(keyboardPin, OUTPUT);
  digitalWrite(keyboardPin, LOW); // connect button pin to ground

  pinMode(key1InterruptPin, INPUT);
  digitalWrite(key1InterruptPin, HIGH); // pull up
  pinMode(key2InterruptPin, INPUT);
  digitalWrite(key2InterruptPin, HIGH); // pull up 
  attachInterrupt(key1Interrupt, key1pressed, FALLING);
  attachInterrupt(key2Interrupt, key2pressed, FALLING);
  key1int_guard=true;
  key2int_guard=true;
 
  pinMode(FanVoltagePin, INPUT);
  analogReference(DEFAULT);
 
// initialize LEDs 
  pinMode(redLED, OUTPUT);
  analogWrite(redLED, 255);
  pinMode(greenLED, OUTPUT);
  analogWrite(greenLED, 255); 
  pinMode(blueLED, OUTPUT);
  analogWrite(blueLED, 255); 
  pinMode(LEDcommonPin, OUTPUT);
  digitalWrite(LEDcommonPin, LOW);
 
//  pinMode(8, OUTPUT);

//initialize control pins 
  pinMode(TriacPin, OUTPUT);
  digitalWrite(TriacPin, LOW);

  pinMode(FAN_PWM, OUTPUT);
  analogWrite(FAN_PWM, 0);

  state = OFF;
 
//turn the PID on
  myPID.SetMode(AUTOMATIC);

// wait for MAX chip to stabilize
//  delay(500);
// blink LED 3 times to indicate ready state
  RGB(50, 50, 50);
  for (byte i=0; i<=6; i++){
    toggle(LEDcommonPin); delay(120);
  } 
  // currentTemperature=thermocouple.readCelsius(); 
  // Serial.print("Start temperature = "); Serial.println(currentTemperature);
  P=3; I=0.4; D=0.1; feedbackFactor=1;
  Serial.print("P=");  Serial.print(P);  Serial.print("\tI=");  Serial.print(I);  Serial.print("\tD=");Serial.println(D);
  Serial.println("Time\tTemp\tSetting\tFanPower\tTriacPower");

  myGLCD.InitLCD(65);
  myGLCD.setFont(SmallFont);

  TriacSwitch=millis();
  profile=2;
}

void loop() {
  switch (state) {
    case HEATING:
           if (profile==5 && seconds>8) currentTemperature=profiles[profile].Stage1Temp+2;
           if (currentTemperature>=(profiles[profile].Stage1Temp-10)) {
             state = 2;
             ProcessTime=seconds;
             setTemperature=profiles[profile].Stage1Temp;
             setDuration=profiles[profile].Stage1Time;
             myPID.SetTunings(P, I, D);
             Serial.println("\t\t\t\t\tHeating complete");
           }
           break;
    case STAGE1:
           if (seconds>ProcessTime+profiles[profile].Stage1Time) {
             ProcessTime=seconds;
             state=3;
             setTemperature=profiles[profile].Stage2Temp;
             setDuration=profiles[profile].Stage2Time;
             P=3;
             myPID.SetTunings(P, I, D);
             Serial.println("\t\t\t\t\tStage 1 complete");
           }
           break;
    case STAGE2:
           if (seconds>ProcessTime+profiles[profile].Stage2Time) {
             ProcessTime=seconds;
             state=4;
             setTemperature=profiles[profile].Stage3Temp;
             setDuration=profiles[profile].Stage3Time;
             myPID.SetTunings(P, I, D);             
             Serial.println("\t\t\t\t\tStage 2 complete");
           }
           break;
    case STAGE3:
           if (seconds>ProcessTime+profiles[profile].Stage3Time) {
             ProcessTime=seconds;
             state=5;
             currentTriacPower=0;
             currentFanPower=profiles[profile].CoolPower;
             setFanPower(currentFanPower);
             CoolerDuration=profiles[profile].CoolTime;
             setTemperature=0;
             PIDenable=false;
             Serial.println("\t\t\t\t\tStage 3 complete");
           }
           break;
    case COOLING:
           if (currentTemperature<=profiles[profile].FinalTemp || seconds>ProcessTime+profiles[profile].CoolTime) {
             state=OFF;
             LED(OFF);
             seconds=0;
             key1int_guard=true;
             key2int_guard=true;
             Serial.println("\t\t\t\t\tCooling complete");
           }
           break;
    case START: // if key was pressed
             // send the settings data
             Serial.print("Profile:"); Serial.println(profiles[profile].name);             
             Serial.print("Stage1: "); Serial.println(profiles[profile].Stage1Temp);
             Serial.print("Stage2: "); Serial.println(profiles[profile].Stage2Temp);
             Serial.print("Stage3: "); Serial.println(profiles[profile].Stage3Temp);
             
             currentFanPower=profiles[profile].HeatFanPower;
             setFanPower(currentFanPower);
             currentTriacPower=profiles[profile].HeaterPower;
             setTemperature=profiles[profile].Stage1Temp;
             setDuration=profiles[profile].Stage1Time;
             PIDenable=true;
             P=2;
             myPID.SetTunings(P, I, D);                         
             seconds=0;
             Tstart=millis();
             state=1;
           break;
    default:
             currentTriacPower=0;
             currentFanPower=0;
             setFanPower(currentFanPower);
             PIDenable=false;
  }
 
  if (Abort) {
     state=OFF;
     key1int_guard=true;
     Serial.println("Abort!");
   } 
   
   updateTime_and_Temp();
   Triac();
}

My DIY roaster thread
My work-in-progress roaster project
 
vahegan

Quote

oldgearhead wrote:

If no change is made in blower pressure during the roast as the beans get lighter the BMT probe will be influenced more by the PVT than the BT (bean temp). For two years I always adjusted the PVT during each roast, but recently I have just set a constant PVT temperature, and adjusted the blower pressure about four times during the roast to control the BMT.


I do not quite get that. The BMT probe is in the chamber, touching the beans and the hot air. The air that enters the chamber is already hot. and its temperature is determined by the power that is applied to the heater by the PID algorithm. So, regardless of what the ambient temperature is, hot air temperature must correspond to the temperature setting. Of course, blower pressure would also affect the temperature, but that's yet another parameter to control, which would make things more complicated. Besides, there us one more reason I am afraid to fiddle much with the blower: with smaller beans like Yirgacheffe, it is already starting to spit them out at some stage when they get lighter. I am afraid to loose all my coffee if I start playing with the blower speed towards the increase, whereas when adjusting towards decrease, there might be problems with agitation. I was thinking to experiment with maximum and minimum speeds for a given amount of beans, but their weight and size changes at different roast stages. Therefore I decided to leave the blower speed constant for the time being.

Speaking of spitting beans, I noticed that more beans are trying to fly out of the roaster mouth somewhere at the final stage, than at the cooler stage when I increase blower speed by some 20%. I don't quite understand this yet, the only explanation I can think of is that beans expand when they are hot, and shrink down when they are cooler.

Quote

One more tip - Try to cool your beans faster with an external cooler.


OK. It currently takes me about 1:40 minutes to cool down from about 214C (about 417F) to 45C (about 113F). I am not sure I will achieve a faster cool in a colander, but can give it a try.
My DIY roaster thread
My work-in-progress roaster project
 
oldgearhead

Quote

vahegan wrote:

Quote

oldgearhead wrote:

If no change is made in blower pressure during the roast as the beans get lighter the BMT probe will be influenced more by the PVT than the BT (bean temp). For two years I always adjusted the PVT during each roast, but recently I have just set a constant PVT temperature, and adjusted the blower pressure about four times during the roast to control the BMT.


I do not quite get that. The BMT probe is in the chamber, touching the beans and the hot air. The air that enters the chamber is already hot. and its temperature is determined by the power that is applied to the heater by the PID algorithm. So, regardless of what the ambient temperature is, hot air temperature must correspond to the temperature setting. Of course, blower pressure would also affect the temperature, but that's yet another parameter to control, which would make things more complicated. Besides, there us one more reason I am afraid to fiddle much with the blower: with smaller beans like Yirgacheffe, it is already starting to spit them out at some stage when they get lighter. I am afraid to loose all my coffee if I start playing with the blower speed towards the increase, whereas when adjusting towards decrease, there might be problems with agitation. I was thinking to experiment with maximum and minimum speeds for a given amount of beans, but their weight and size changes at different roast stages. Therefore I decided to leave the blower speed constant for the time being.

Speaking of spitting beans, I noticed that more beans are trying to fly out of the roaster mouth somewhere at the final stage, than at the cooler stage when I increase blower speed by some 20%. I don't quite understand this yet, the only explanation I can think of is that beans expand when they are hot, and shrink down when they are cooler.

Quote

One more tip - Try to cool your beans faster with an external cooler.


OK. It currently takes me about 1:40 minutes to cool down from about 214C (about 417F) to 45C (about 113F). I am not sure I will achieve a faster cool in a colander, but can give it a try.


Yes, at the start of the roast your temperature probe reflects the temperature of the hot air, the beans, and the plate its mounted in.
As the roast progresses the beans double in size, and lose their moisture.
Therefore, they are lighter and have more surface area, they require much less air to remain 'fluid', so they 'fly' higher. As the beans become lighter your temperature probe is influenced more by the hot air, and less by the beans and the mounting plate.

However, your total roast times (11-15 minutes) appear perfect to me, and if you are happy with the taste of coffee, don't change anything.

Cooling - Are the cooling temperatures you reported from your roaster probe or the beans? I'm very surprised the 'popper' can cool that well with only a 20% increase in blower speed. But that's fine, don't bother with the colander.

Ambient air - Electric heating units can only raise the temperature of the air supplied to them. Therefore, as long as your ambient air stays within range of your heater's capability you won't see much of an affect.But I know a couple of 'popper' users who rely either a cardboard box or a heat gun when it gets cold.
 
vahegan

Quote

oldgearhead wrote:

As the roast progresses the beans double in size, and lose their moisture.
Therefore, they are lighter and have more surface area, they require much less air to remain 'fluid', so they 'fly' higher. As the beans become lighter your temperature probe is influenced more by the hot air, and less by the beans and the mounting plate.


OK, I now get what you mean

Quote

However, your total roast times (11-15 minutes) appear perfect to me, and if you are happy with the taste of coffee, don't change anything.

Well, this is a tricky point. I've got several coffees and more are yet to arrive (I have to order the good ones from overseas, that takes some time). I am drinking it, and I like the results much better than stale store-bought coffee. But I don't know yet what they will max out, and I am sure it'll be possible to obtain much better results with what I have... I am afraid I am on a slow learning curve now

Quote

Cooling - Are the cooling temperatures you reported from your roaster probe or the beans? I'm very surprised the 'popper' can cool that well with only a 20% increase in blower speed. But that's fine, don't bother with the colander


Yeah, I have just one probe in the bottom of the popper can, all my temperatures are from there. But when I remove the beans just after cooling, they are hardly warm to the touch - just about 40-42C (104-108F)

According to the sticker, my blower motor is rated at 24V DC. I measured the voltage in its original connection, and there was about 18V on it. That's what I supply to the motor presently, but its on a PWM control, and my power supply is capable of supplying up to 30V, so I can easily blow all the beans away should I wish to. When I speak about 20% increase of blower speed during cooling, I mean a 20% increase of PWM ratio, which translates into roughly 20% voltage increase on the motor, but it is hard to judge on how much the actual flow changes. Theoretically, for a brushed DC motor, the dependence of RPM on voltage is linear, so I expect that flow increase should also be around 20%.

Quote

Ambient air - Electric heating units can only raise the temperature of the air supplied to them. Therefore, as long as your ambient air stays within range of your heater's capability you won't see much of an affect.But I know a couple of 'popper' users who rely either a cardboard box or a heat gun when it gets cold.

OK, I see your point. Yes, indeed, my friend who was using a 1040W popper reported that he was hardly getting there and baked a batch or two due to too low temps. My popper is 1200W, and this was sufficient even when the ambient was freezing cold (I am roasting at the balcony), although it seems a tad slow to get to the last stage. Well, I think I'll be able speed up this ramp, should I need it, by dropping the blower speed a little bit.

By the way, I inserted a meat probe in the chamber during the roast today, and I've got a reading some 10C (about 18F) higher than what my probe reading. I think this explains why I am getting too dark roasts with standard profiles. Will have to check the temperature difference also at the drying and Mayard phases, to find out whether it is a constant error or if it is proportional to measured temperature. to be able to make corrections. I think this difference is due to the cold junction compensation circuit in the thermocouple chip. There is no cold junction in the circuit, and the chip is compensating based on an on-the-chip temperature sensor. I placed the chip below the heater, in the hope that its case temperature will be equal to that of ambient air that is being sucked in by the blower. However, I am not sure what's the chip temperature during roast and this may be affecting my probe readings. The other reason may be a low-quality thermocouple... Anyway, I need to compensate for this error and therefore I shall find out how the error depends on the actual temperature range.
My DIY roaster thread
My work-in-progress roaster project
 
vahegan
Yeah, BTW, thank you for the nice photo with roast temperatures in your last post. I'll give these settings a try once I compensate for my thermocouple error.

I've also got a 5-stage profile that someone developed in analogy with a Hottop drum roaster, I am thinking to program this profile as well:

* 160C (320F) ? 5 minutes
* 190C (374F) ? 4 minutes
* 196C (385F) ? 2 minutes
* 204C (400F) ? 1 minute
* 210C (410F) ? 3 minutes
My DIY roaster thread
My work-in-progress roaster project
 
allenb

Quote

What do you mean when you say "Roasting in power level stages"? My stages are based on my attempts to stabilize the temperature at certain stages, and the PID controller varies the power to maintain the temperature stable.


Roasting by holding a setpoint at a steady state by bean temperature or environment temperature for X minutes and seconds and on up through successive stages is what I meant by stages.

Quote

I was also not able to grasp the idea of why do we need to keep the temperature rising all the time, and never stall? I think I am missing something important here, can you please offer some more explanation on this point, or direct me to some reading on the matter? So far, I thought that stable temperature during roast stages was the key to success, and have put quite some effort to achieve this.


For coffee to develop properly, it needs to continually rise in temperature. Numerous studies have been undertaken over the last century that concluded that for the hundreds of chemical reactions to properly take place, bean temperature must never stop increasing (stall) and especially never decrease. When this occurs, reaction X, needed to allow the next reaction to properly execute, itself is compromised which negatively effects all subsequent reactions. It?s fine to use multiple stages as long as the end result allows the beans to continually rise and not stall. For a fluidbed roaster, it?s best to utilize a ramp versus stages so there is a continual rise in environment temperature.

Quote

Again, my knowledge is yet insufficient to quickly grasp the meaning. What do you mean by "variations of the 4-4-4" - do you mean temperature settings, PID values, or roast stage durations?


In general, many in the coffee roasting community have broken down a roast into three phases. The drying phase being from start of roast to when the beans go from green to a yellow or yellow/tan and is at an internal temperature where free moisture has been driven out (around 150C). This relates to the first of the three 4?s in the 4-4-4. The second phase is the browning phase which is from around 150C to first crack and represents the second 4. The last phase is referred to as the finish phase from start of first crack to end of roast. One would typically only hit 4 minutes after first crack if taking the roast beyond a medium roast otherwise would be closer to 2 ? or 3 minutes. The concept of the 4-4-4 is to give someone new to roasting a place to start to prevent them from blindly trying a myriad of profiles that will certainly produce poor results before finally arriving at a profile that produces good coffee. ?wandering with closed eyes in a dark room that is full of obstacles and not...? Great analogy!

Just a couple of pointers to help you move forward; Use high enough heat at the start (no need to warm up a fluidbed) to get your beans to 105C in 1 ? to 2 minutes then taper off the heat to allow hitting yellow/tan (150C) by minute 4 or up to minute 5, then keep the beans rising in temperature smoothly to get to first crack in another 3 to 5 minutes then after the beginning of first crack back off the heat enough to allow finishing the roast in another 1 ? to 3 minutes. Then remember to try all sorts of variations on this theme to find each coffee?s sweet spot.
On fan speed adjustments during a roast. It?s best to leave the blower of a fluidbed manually adjustable (continuously variable) and make adjustments as needed to keep the beans flowing nicely but not flying chaotically. As you?ve noted, as the beans expand and lighten in weight, they will continually become more airborne and launch themselves out of the roast chamber. If you find a way to automate this process that will be great and please share your process!

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
vahegan


Thank you very much, Allen! That's an awesome wealth of new information for me. Will have to digest it, and think what needs be changed in my software. I'll come back smile Thanks, again, many things become clearer now.
My DIY roaster thread
My work-in-progress roaster project
 
vahegan
OK, so after a few days of digesting of the information provided, I modified my software according to Allen's suggestion.

I heat up to 105C (it took me about 80 seconds to get there - possibly could do it even quicker after playing with PID settings). Then I ramp the temp to 152C within in 160 seconds, another ramp from 152C to 182C within 220 seconds, the final ramp to 223C in 140 seconds, followed by cooling to 45C in about 100 seconds. Total time is around 12 minutes. I am attaching the log. Would really appreciate your comments on this.

s25.postimg.org/tliojfjfz/Ramp_04_04_2014.png

As always, the blue line is the actual temperature measured by thermocouple (I added calibration factors to the thermocouple in this edition of software). the red line is the temperature setting, and the green line is power (%) that is applied to the heater.
My DIY roaster thread
My work-in-progress roaster project
 
vahegan
The ramp rates are as follows:

1. Heating to 105C/221F: 0.9C/sec or 1.6F/sec (my heater is capable of doing twice as quick in this temperature range, but it will be difficult to avoid an overshoot then).
2. Ramp to 152C/305F: 0.3C/sec or 0.5F/sec,
3. Ramp to 182C/360F: 0.14C/sec or 0.7F/sec,
4. Ramp to 223C/433F: 0.3C/sec or 0.5F/sec
5. Cooling to 45C/113F: 1.8C/sec or 3.2F/sec.

I plan to buy a kerosene lamp glass and install instead of the plastic cap - then I will be able to improve the cooling speed by driving more power to the motor. In my present setup it will blow the beans out of the popper if I increase the motor speed.
My DIY roaster thread
My work-in-progress roaster project
 
allenb
Looking much better! What temperature are you seeing at start of first crack? I would alter your program to allow stretching the period between the start of first crack and end of roast to between 1 1/2 and 3 minutes. Many find best results to be anywhere between 7 and 10 degrees per minute rate of rise during the finish phase. You'll find lots of variation in body and acidity by varying the rate of rise during this phase especially if you're going for a very light roast. For light roasts with coffees that are inherently high in acidity, stretching this phase can reduce acidity and add body.

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
vahegan
Thank you for your notes, Allen!

Quote

allenb wrote:
Looking much better! What temperature are you seeing at start of first crack?


I have just finished working on the software and I was testing it on an old batch of beans that have been roasted 10 times already smile I will roast a test batch with this new settings today and will tell the first crack time

Quote

I would alter your program to allow stretching the period between the start of first crack and end of roast to between 1 1/2 and 3 minutes. Many find best results to be anywhere between 7 and 10 degrees per minute rate of rise during the finish phase. You'll find lots of variation in body and acidity by varying the rate of rise during this phase especially if you're going for a very light roast. For light roasts with coffees that are inherently high in acidity, stretching this phase can reduce acidity and add body.


7-10F/sec is about twice slower than I am currently using. OK, so I'll update the final stage ramp rate before I roast my actual test batch.
My DIY roaster thread
My work-in-progress roaster project
 
allenb

Quote

7-10F/sec is about twice slower than I am currently using. OK, so I'll update the final stage ramp rate before I roast my actual test batch.


7 to 10F/sec would be a supersonic finish! smoking

I would initiate the final stage ramp to be somewhere around the temperature where first crack is a few seconds underway.

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
vahegan

Quote

allenb wrote:
7 to 10F/sec would be a supersonic finish! smoking


OK, OK, just a small error. 60 times difference, not much ;)

Quote

I would initiate the final stage ramp to be somewhere around the temperature where first crack is a few seconds underway.


Well, I just roasted another batch. Here's the result:

s25.postimg.org/slsdnq4a7/Honduras_04_04_2014.png

First crack was somewhere around 10:50 to 11:00 minute, at around 210C (410F). I indicated first crack with the vertical line. After that ramp continued for some 1:50 minutes. Per your suggestion, I may prolong the final stage time just a little bit more next time.

I've got a nice light roast, a few beans are maybe even too light:

s25.postimg.org/70nb047jj/2014_04_04_20_34_20.jpg

Roast color is not very even, I am not sure, it may be characteristic for this particular bean type. Will cup in the morning.
Edited by vahegan on 04/04/2014 12:34 PM
My DIY roaster thread
My work-in-progress roaster project
 
allenb
I've had a couple of costas and some dry process coffees that look very similar to the color variation I see in your photo. It's most likely the coffee and not related to your roasting.

Let us know how this cups and be sure to try variations on your profiles with a little faster rate of rise getting to 1st crack and slower rate of rise from 1st crack to finish and compare them. Some coffees love to go slow and some of the high growns like to zip along a faster clip.

Allen
1/2 lb and 1 lb drum, Siemens Sirocco fluidbed, presspot, chemex, cajun biggin brewer from the backwoods of Louisiana
 
vahegan
Just cupped the new roast. This time it has much more aroma than I have seen in this bean ever before.

Thanks so much, Allen, for your very useful tips. I will try to work further on...
My DIY roaster thread
My work-in-progress roaster project
 
Jump to Forum: