# Cascade Control of Coffee Roasting Degree in a Spouted Bed Batch Process Based on a Real-Time Imaging Analysis

Authors: Omar R. Gómez-Gómez; Guadalupe M. Guatemala-Morales; J. Paulo García-Sandoval; Enrique Arriola-Guevara
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

On this work, the experimental implementation of a cascade control algorithm to regulate coffee roasting degree in a batch spouted bed process is presented. The control algorithm is composed of an inner control loop that regulates the temperature of the hot air inflow used to roast coffee grains inside a spouted bed, while an outer control loop, based on imaging processing techniques, tracks on real time the coffee roasting degree and decides if the inflow air temperature must be modified. To achieve this goal, a colour-matching algorithm is used to compare a colour spectrum obtained from images acquired on real time, from a peephole on the spouted bed, with the colour spectrums of several reference images with different degrees of roasting. Match scores are computed based on the similarity between the colour spectrums. With the match scores, a roasting index is finally calculated to assess the degree of roasting, allowing to automatically track the roasting progress to decide if the batch roasting process has achieved the desired roasting degree. The experimental results show that the control scheme is able to robustly achieve the desired roasting degree with excellent effectiveness.


---

## Body

## 1. Introduction

The quality of coffee is mainly based on two aspects, the beans growing conditions and, after recollection, the roasting process [1]. The growing conditions depend on multiple factors, such as the soil constitution and the microclimate, among others, while the roasting process is a key controllable thermal process that modifies the chemical, physical, structural, and sensory properties of green coffee beans [2]. Thus, coffee beans growing conditions are mostly uncertain and almost uncontrollable, while the roasting process can be properly controlled, allowing, up to certain degree, to compensate the variations of the green coffee beans characteristics.The main physical and structural changes in coffee beans during roasting are the increase in volume, weight loss (water, carbon dioxide, and volatile compounds), increase in porosity, and colour change [3, 4]. In particular, the colour change of the grain through the process is due to the formation of melanoidins, which are dark molecules resulting from the Maillard and caramelization reactions. Both chemical reactions are closely related to the final sensory properties, so the correct definition of the degree of roasting of coffee is of paramount importance, since it directly influences the quality of the beverage [5]. On the other hand, there are many ways to define the degree of roasting (colour development, moisture loss, content of chlorogenic acids, etc.), but the most used indicator is the colour of whole or ground grains [6].During the roasting process, coffee beans are heated either by conduction, radiation, or convection [7]. To guarantee a more homogeneous and faster heat transfer, the beans should be in constant movement either induced by rotation or by the flow of hot gases [2].Rotatory drums (horizontal or vertical with paddles) are the most traditional equipment used in the coffee industry; however, in this equipment the heat is mainly transferred by conduction, while in fluid bed and spouted bed roasters [8] the heat is mainly transferred by convection with high-velocity gas flows [6, 7], allowing to decrease the roasting times and to optimize the energy consumption. In the last decade, the use of spouted beds for grains drying and roasting has become more feasible. In particular, Arriola-Guevara et al. [9] have proposed an innovative spouted bed with a characteristic geometry that does not have dead zones nor mobile parts, with a draft tube that allows drying or roasting with low-pressure drops. This spouted bed has been recently used to roast coffee beans [10]. However, fluid bed and spouted bed roasters are more difficult to operate and control due to the variations in the inflow air humidity, associate to environmental conditions, and to the inherent inclusion of solids fluidization dynamics, that are intrinsically chaotic or even unstable [11].In the coffee industry, due to the variations in the raw material and environmental conditions, the roasting process depends mostly on toaster masters that, based on their experience, use subjective and empirical indicators (mostly sensorial factors: smell, sight, and hearing) to decide temperature-time profile along the roasting process to achieve the desired toasting degree. In the best of the cases, they may use colorimeters or spectrophotometers that are economically unfeasible for small coffee maker industries [5, 12]. Recently, some efforts have been carried out to technify the tracking of the roasting degree along the roasting process, such as classification methods by hyperspectral imaging analysis [12–15], coffee roasting acoustics [16], and prediction of brightness and surface area variations [17]. However, this type of efforts should be continued to finally “close the loop” and manipulate the roasting process using this class of technified measurements.In this work, we propose a cascade control algorithm to regulate coffee roasting degree in a batch spouted bed process. The control algorithm is composed of an inner control loop that regulates the hot air inflow temperature used to roast coffee grains inside the spouted bed, while an outer control loop, based on imaging processing techniques, tracks on real time the coffee roasting degree and decides if the inflow air temperature must be modified. To achieve this goal, a roasting index based on colour-matching techniques is proposed to assess the degree of roasting and allows to automatically track the roasting progress and to decide if the batch roasting process has achieved the desired roasting degree.


## 2. Materials and Methods

### 2.1. Coffee Roasting

Batches of 1.3 kg of green coffee beans (Coffee arabica) from Jaltenango, Chiapas, Mexico, were roasted in a roaster schematically, as shown in Figure 1. The compressor (C-1) supplies pressurized air and with the regulatory valve (FV) and the rotameter (FI) the air pressure and flow are set to be 2.5 kgf/cm2 and 115 L/min. This air passes through a heat exchanger (E-1) powered by a resistance of 2,400 W@220 V. The air temperature is measured after heating, right before it enters the bed with a thermocouple (TE). The spouted bed (S-1) comprises two regions: annulus and draft tube. Solids are fed from the top, filling the annulus region. The particles that accumulate at the bottom of the draft tube rise through it as a result of the compressed hot air stream that enters through a nozzle situated at the bottom left corner, generating the characteristic spout in the top and promoting the cyclic movement of particles. Once the roasting is over, solids are discharged on the bottom. Roasting was performed by triplicate.Figure 1
Process and instrumentation diagram of the coffee roasting process.


### 2.2. Vision System and Images Processing

The vision system developed for this work used a Logitech webcam model C930E with a maximum resolution of 2304× 1536 pixels, automatic focus, and correction of light, mounted on a tripod and focusing to the peephole of the spouted bed. A small lighting device was built with a 5 m LED strip of lights with a colour temperature of 6500 K (D65 illuminant) coupled with a light diffuser.The image processing was carried out in a personal computer, with an Intel Core i5 7300HQ processor, 8 GB of RAM, 256 GB internal storage in SSD, LabVIEW image processing and analysis software with the Vision Development Module (VDM) package, both version 2012. To obtain the images of the coffee, the webcam was placed with its support in front of the peephole of the source bed; in order to acquire correctly illuminated images, the device was installed with LED lights, behind it. The image was brought to a standard size of complete visualization in the virtual panel of800∗600 pixels; however, the acquired images were cut to 263∗268 pixels to focus the analysis only in the coffee beans and remove the edges of the image with part of the bed and the body of the peephole. Thus, the cut images to be processed maintained these last dimensions for all experiments. Images were acquired each 30 seconds, along the roasting process. The colour-matching algorithm analyses the 263∗268 pixels images as a whole, regardless of the number of beans in the image, because, due to the roasting process, their size is variable and increases during the roasting process.A roasting index was proposed to assess the degree of roasting. This index is computed as follows:(i)
Learning step: a set ofN reference images with different degrees of roasting are acquired in a preliminary experiment, then these images are classified and ordered in ascending roasting degree by a roaster master, assigning an increasing index i=1,2,…,N, where i=1 represents green coffee grains and i=N represents very dark roasted coffee. Then, colour spectrums of the N reference images are calculated.(ii)
Matching phase: each image to be assessed is compared to each reference image using a standard colour-matching algorithm [18]. This algorithm quantifies which colours and how much of each colour exist in the ith reference image (i=1,2,…,N) and uses this information to check if the acquired image contains the same colours in the same ratio. The colour spectrum obtained from the target image is compared to the reference colour spectrum taken during the learning step. A match score is computed based on the similarity between these two-colour spectrums using the Manhattan distance between two vectors. A fuzzy membership weighting function is applied to both the colour spectrums before computing the distance between them. The weighting function compensates for some errors that may occur during the binning process in the colour space. The fuzzy colour comparison approach provides a robust and accurate quantitative match score. The match score, xC,i, ranging from 0 to 1,000, defines the similarity between the colour spectrums. A score of zero represents no similarity between the colour spectrums, whereas a score of 1,000 represents a perfect match.(iii)
Roasting index computation: the roasting index is computed with(1)σ=∑i=1NxC,iμi∑i=1NxC,i,where μi is the weighting factor of the ith reference image. For this particular case, it is chosen that μi=i, then the roasting index is a continuous variable with range of variation 0≤σ≤N. Low values of σ describe green coffee grains, while values near to N describe dark roasted coffee grains.


### 2.3. Instrumentation and Control Algorithm

The cascade control algorithm (see the block diagram of Figure2) is composed of an inner control loop that regulates the hot air inflow temperature used to roast coffee grains inside the spouted bed, while an outer control loop, based on imaging processing techniques, tracks on real time the coffee roasting degree and decides if the inflow air temperature must be modified. For the inner control loop (see Figure 1), a PID controller (TC in Figure 1) is used to manipulate a relay (TY) that regulates the electric current of the heat exchanger’s resistance in order to control the temperature signal received from the thermocouple (TE); this inner control loop also receives a signal from the outer loop that allows modifying the temperature reference when the roasting index has reached the set point. The outer loop controller is composed of personal computer (MC) that processes the images received from the camera (CE); as described above, this computer is connected to a PLC (CC compact-DAQ from Virtual instruments) that is able to modify the reference of the temperature manipulated in the inner loop. For operational and security purposes, this PLC also has programmed sequential steps that allows to activate and deactivate both the resistance in the inner loop and the air flow using a relay (FY). The inner control loop uses continuous temperature measurements, while the outer control loop has a sampling time of 30 seconds.Figure 2
Block diagram of cascade control applied to the coffee roasted process.


### 2.4. Experimental Tests

Several experiments varying the inflow air temperature and the roast index reference were carried out to tune the control loops, and once tuned, several experiments were carried out to test proposed cascade algorithm performance; however, for the sake of compactness, here only nine representative experimental tests are shown. The first experiment was carried out only with the inner control loop activated, in order to test temperature response and to acquire the set ofN references images used in the colour-matching algorithm. The temperature reference for this experiment was set to be 475°C and the system was initially at room temperature. The remaining 8 experiments were carried out with the full cascade control that includes the tracking of the roasting index. Set point roasting index of experiments 2 to 5 was set to be in the medium roasting coffee region, while experiments 6 to 9 have a set point in the dark roasting coffee region. The air temperature of experiments 2 and 3 was around 475°C, while the air temperature of experiments 4 to 9 was nearby 500°C. The roasting time was variable and depended on the environmental and operational conditions. The colour (in L∗a∗b∗ space colour) of the final product obtained in experiments 2 to 5 was analysed using a portable MiniScan EZ colorimeter (D65 illuminant) in order to compute the mean value and standard deviation to assess the reproducibility of the reference tracking in the cascade controller.


## 2.1. Coffee Roasting

Batches of 1.3 kg of green coffee beans (Coffee arabica) from Jaltenango, Chiapas, Mexico, were roasted in a roaster schematically, as shown in Figure 1. The compressor (C-1) supplies pressurized air and with the regulatory valve (FV) and the rotameter (FI) the air pressure and flow are set to be 2.5 kgf/cm2 and 115 L/min. This air passes through a heat exchanger (E-1) powered by a resistance of 2,400 W@220 V. The air temperature is measured after heating, right before it enters the bed with a thermocouple (TE). The spouted bed (S-1) comprises two regions: annulus and draft tube. Solids are fed from the top, filling the annulus region. The particles that accumulate at the bottom of the draft tube rise through it as a result of the compressed hot air stream that enters through a nozzle situated at the bottom left corner, generating the characteristic spout in the top and promoting the cyclic movement of particles. Once the roasting is over, solids are discharged on the bottom. Roasting was performed by triplicate.Figure 1
Process and instrumentation diagram of the coffee roasting process.


## 2.2. Vision System and Images Processing

The vision system developed for this work used a Logitech webcam model C930E with a maximum resolution of 2304× 1536 pixels, automatic focus, and correction of light, mounted on a tripod and focusing to the peephole of the spouted bed. A small lighting device was built with a 5 m LED strip of lights with a colour temperature of 6500 K (D65 illuminant) coupled with a light diffuser.The image processing was carried out in a personal computer, with an Intel Core i5 7300HQ processor, 8 GB of RAM, 256 GB internal storage in SSD, LabVIEW image processing and analysis software with the Vision Development Module (VDM) package, both version 2012. To obtain the images of the coffee, the webcam was placed with its support in front of the peephole of the source bed; in order to acquire correctly illuminated images, the device was installed with LED lights, behind it. The image was brought to a standard size of complete visualization in the virtual panel of800∗600 pixels; however, the acquired images were cut to 263∗268 pixels to focus the analysis only in the coffee beans and remove the edges of the image with part of the bed and the body of the peephole. Thus, the cut images to be processed maintained these last dimensions for all experiments. Images were acquired each 30 seconds, along the roasting process. The colour-matching algorithm analyses the 263∗268 pixels images as a whole, regardless of the number of beans in the image, because, due to the roasting process, their size is variable and increases during the roasting process.A roasting index was proposed to assess the degree of roasting. This index is computed as follows:(i)
Learning step: a set ofN reference images with different degrees of roasting are acquired in a preliminary experiment, then these images are classified and ordered in ascending roasting degree by a roaster master, assigning an increasing index i=1,2,…,N, where i=1 represents green coffee grains and i=N represents very dark roasted coffee. Then, colour spectrums of the N reference images are calculated.(ii)
Matching phase: each image to be assessed is compared to each reference image using a standard colour-matching algorithm [18]. This algorithm quantifies which colours and how much of each colour exist in the ith reference image (i=1,2,…,N) and uses this information to check if the acquired image contains the same colours in the same ratio. The colour spectrum obtained from the target image is compared to the reference colour spectrum taken during the learning step. A match score is computed based on the similarity between these two-colour spectrums using the Manhattan distance between two vectors. A fuzzy membership weighting function is applied to both the colour spectrums before computing the distance between them. The weighting function compensates for some errors that may occur during the binning process in the colour space. The fuzzy colour comparison approach provides a robust and accurate quantitative match score. The match score, xC,i, ranging from 0 to 1,000, defines the similarity between the colour spectrums. A score of zero represents no similarity between the colour spectrums, whereas a score of 1,000 represents a perfect match.(iii)
Roasting index computation: the roasting index is computed with(1)σ=∑i=1NxC,iμi∑i=1NxC,i,where μi is the weighting factor of the ith reference image. For this particular case, it is chosen that μi=i, then the roasting index is a continuous variable with range of variation 0≤σ≤N. Low values of σ describe green coffee grains, while values near to N describe dark roasted coffee grains.


## 2.3. Instrumentation and Control Algorithm

The cascade control algorithm (see the block diagram of Figure2) is composed of an inner control loop that regulates the hot air inflow temperature used to roast coffee grains inside the spouted bed, while an outer control loop, based on imaging processing techniques, tracks on real time the coffee roasting degree and decides if the inflow air temperature must be modified. For the inner control loop (see Figure 1), a PID controller (TC in Figure 1) is used to manipulate a relay (TY) that regulates the electric current of the heat exchanger’s resistance in order to control the temperature signal received from the thermocouple (TE); this inner control loop also receives a signal from the outer loop that allows modifying the temperature reference when the roasting index has reached the set point. The outer loop controller is composed of personal computer (MC) that processes the images received from the camera (CE); as described above, this computer is connected to a PLC (CC compact-DAQ from Virtual instruments) that is able to modify the reference of the temperature manipulated in the inner loop. For operational and security purposes, this PLC also has programmed sequential steps that allows to activate and deactivate both the resistance in the inner loop and the air flow using a relay (FY). The inner control loop uses continuous temperature measurements, while the outer control loop has a sampling time of 30 seconds.Figure 2
Block diagram of cascade control applied to the coffee roasted process.


## 2.4. Experimental Tests

Several experiments varying the inflow air temperature and the roast index reference were carried out to tune the control loops, and once tuned, several experiments were carried out to test proposed cascade algorithm performance; however, for the sake of compactness, here only nine representative experimental tests are shown. The first experiment was carried out only with the inner control loop activated, in order to test temperature response and to acquire the set ofN references images used in the colour-matching algorithm. The temperature reference for this experiment was set to be 475°C and the system was initially at room temperature. The remaining 8 experiments were carried out with the full cascade control that includes the tracking of the roasting index. Set point roasting index of experiments 2 to 5 was set to be in the medium roasting coffee region, while experiments 6 to 9 have a set point in the dark roasting coffee region. The air temperature of experiments 2 and 3 was around 475°C, while the air temperature of experiments 4 to 9 was nearby 500°C. The roasting time was variable and depended on the environmental and operational conditions. The colour (in L∗a∗b∗ space colour) of the final product obtained in experiments 2 to 5 was analysed using a portable MiniScan EZ colorimeter (D65 illuminant) in order to compute the mean value and standard deviation to assess the reproducibility of the reference tracking in the cascade controller.


## 3. Results and Discussion

### 3.1. Inner Control Loop Test and Coffee Reference Images

After the inner control loop that regulates the spouted bed was tuned, the inner loop was tested to verify if it was able to regulate the temperature. Figure3 shows the temperature profile of the inflow air in experiment 1. The set point of temperature was set to be 475°C and it was reached approximately at 10 minutes; this period is necessary to heat the full roaster; however, once the set point was reached, the spouted bed was loaded with 1.3 kg of green coffee beans and the controller was able to maintain this temperature with despicable variations.Figure 3
Experiment 1: experimental temperature profile for the inner control loop test.Based on the roaster master knowledge, it was decided to use 7 reference images, i.e.,N=7. These reference images, necessary to compare against the real-time images, were obtained as follows: immediately after the green coffee beans were loaded, the first reference image was taken (i=1); then, based on the direct inspection of the coffee beans through the peephole and the aroma that the beans emitted during roasting, the roaster master decided the sampling times for the 6 remaining reference images (i=2,3,…,7) that were taken after 24, 30, 41, 48, 53, and 56 minutes from the beginning of the roasting, respectively. These images were classified by a toaster master as follows: light brown coffee (i=2), brown coffee (i=3), light roasted coffee (i=4), medium roasted coffee (i=5), dark roasted coffee (i=6), and very dark roasted coffee (i=7), respectively (see Figure 4). It was also established that approximated values of the roasting index in the regions of light, medium, and dark roasting coffee are 4≤σ<4.5, 4.5≤σ≤5.0, and 5.0<σ≤5.8, respectively. Values above σ=5.8 are related to burnt coffee.Figure 4
Reference coffee images. (a) Green coffee,i=1. (b) Light brown coffee, i=2. (c) Brown coffee, i=3. (d) Light roasted coffee, i=4. (e) Medium roasted coffee, i=5. (f) Dark roasted coffee, i=6. (g) Very dark roasted coffee, i=7.
(a)
(b)
(c)
(d)
(e)
(f)
(g)


### 3.2. Cascade Control Test

Once the learning step described above was completed using the 7 reference images, experiments 2 to 9 were carried out. Figure5 shows the colour and roasting index variations for experiments 2 to 5, where the set point of the roasting index was set to be 4.85, i.e., in the region of medium roasting coffee. The time to reach the set point in experiments 2 and 3 with an operating temperature of 475°C was approximately 40 minutes (see Figures 5(a) and 5(b)), while the time to reach the set point in experiments 4 and 5 with an operating temperature of 500°C was approximately 31 minutes (see Figures 5(c) and 5(d)), suggesting that the relation between roasting time and inflow air temperature is nonlinear, mainly because the chemical reactions that take place in the roasting are exothermic and their reaction velocities follow Arrhenius-like relations with respect to the temperature. In all four experiments, the vision system was able to detect the instant at which the desired roasting degree was reached.Figure 5
Roasting index variation in the batch process for medium roasting experiments with referenceσ=4.85. (a) Experiment 2: T = 475°C. (b) Experiment 3: replica of experiment 2. (c) Experiment 4: T = 500°C. (d) Experiment 5: replica of experiment 4.
(a)
(b)
(c)
(d)CIE 1976L∗a∗b∗ colour scale is the most common scale used to describe the colour in the food industry [19]. Castellanos-Onorio et al. [20] reported that the medium roasting coffee region has L∗ values around 24, while Vignoli et al. [21] estimated that L∗ is around 25 in this region. To assess the reproducibility of the final roasting degree using the tracking of the roasting index, the mean L∗a∗b∗ colour attained in the final product obtained for several medium and dark roasting degrees was analysed using a colorimeter (see Table 1). The mean value of L∗ for medium roasting was 23.41 ± 0.22 (α=0.05) and 17.44 ± 0.48 (α=0.05) for dark roasting. It is important to notice that the standard deviation of L∗ is below 2% with respect to its mean value, while the standard deviation of a∗ and b∗ are below 8% with respect to their mean value, suggesting that the controller reaches the same colour characteristics directly correlated with the roasting degree. Gaurav et al. [22, 23] use a L∗a∗b∗ colour distance defined as(2)ΔELab,i−j=Li∗−Lj∗2+ai∗−aj∗2+bi∗−bj∗2,which allows to compare a pair of L∗a∗b∗ colours (Li∗ai∗bi∗ and Lj∗aj∗bj∗), and they proposed to divide ΔE into five regions:(i)
If0≤ΔELab<1, the difference between both colours is indistinguishable for the human eye(ii)
If1≤ΔELab<2, the difference is only distinguishable for an expert observer(iii)
If2≤ΔELab<3.5, the difference is also distinguishable for inexpert observers(iv)
If3.5≤ΔELab<5, the difference is clearly distinguishable(v)
IfΔELab≥5, the colours are completely differentTable 1
MeanL∗a∗b∗ colour attained in the final product for medium and dark coffee.
Roasting degree
Statistics
L
∗
a
∗
b
∗
Medium roasting
Mean
23.41± 0.22
8.28± 0.49
12.15± 0.67
STD
0.21
0.66
0.64
Dark roasting
Mean
17.44± 0.48
6.32± 0.28
8.22± 0.40
STD
0.35
0.27
0.38With theL∗a∗b∗ values for experiments reported in Table 1 the colour distances can be computed and the mean value for medium roasting is ΔELab,mean=1.20±0.33 (α=0.05), while for dark roasting is ΔELab,mean=0.82±0.18 (α=0.05); therefore, the difference in the colour of the roasted dark coffee is practically indistinguishable for the human eye, while for medium roasting might be indistinguishable for the human eye or only distinguishable for an expert observer.Given that a higher temperature produces a faster roasting and gets similar roasting characteristics, the remaining experiments (6 to 9) were carried out at 500°C. The roasting index set point for experiments 6 and 7 was 5.15, while the set point of experiments 8 and 9 was selected to be 5.28, i.e., in the region of dark roasting coffee. Figure6 presents the colour and roasting index variations for these experiments. Similarly for experiments 2 to 5, the control system helps to achieve the set point of the roasting index; however, for this case, the time to reach the set point in experiments 6 and 7 was approximately 36 minutes (see Figures 6(a) and 6(b)), while the time to reach the set point in experiments 8 and 9 was approximately 31 and 41 minutes, respectively (see Figures 6(c) and 6(d)). The difference between these times can be associated to the prevailing environmental conditions that affect the inflow air characteristics. Experiment 8 was carried out on a sunny day with low humidity, while experiment 9 was carried out on a rainy day with high humidity. Even though these variations in the conditions led to different operation times, the control algorithm was able to reach the correct roasting degree, showing good robustness properties in the face of external perturbations.Figure 6
Roasting index variation in the batch process for dark roasting. (a) Experiment 6: referenceσ=5.15 and T = 500°C. (b) Experiment 7: replica of experiment 6. (c) Experiment 8: reference σ=5.28 and T = 500°C. (d) Experiment 9: replica of experiment 8.
(a)
(b)
(c)
(d)


## 3.1. Inner Control Loop Test and Coffee Reference Images

After the inner control loop that regulates the spouted bed was tuned, the inner loop was tested to verify if it was able to regulate the temperature. Figure3 shows the temperature profile of the inflow air in experiment 1. The set point of temperature was set to be 475°C and it was reached approximately at 10 minutes; this period is necessary to heat the full roaster; however, once the set point was reached, the spouted bed was loaded with 1.3 kg of green coffee beans and the controller was able to maintain this temperature with despicable variations.Figure 3
Experiment 1: experimental temperature profile for the inner control loop test.Based on the roaster master knowledge, it was decided to use 7 reference images, i.e.,N=7. These reference images, necessary to compare against the real-time images, were obtained as follows: immediately after the green coffee beans were loaded, the first reference image was taken (i=1); then, based on the direct inspection of the coffee beans through the peephole and the aroma that the beans emitted during roasting, the roaster master decided the sampling times for the 6 remaining reference images (i=2,3,…,7) that were taken after 24, 30, 41, 48, 53, and 56 minutes from the beginning of the roasting, respectively. These images were classified by a toaster master as follows: light brown coffee (i=2), brown coffee (i=3), light roasted coffee (i=4), medium roasted coffee (i=5), dark roasted coffee (i=6), and very dark roasted coffee (i=7), respectively (see Figure 4). It was also established that approximated values of the roasting index in the regions of light, medium, and dark roasting coffee are 4≤σ<4.5, 4.5≤σ≤5.0, and 5.0<σ≤5.8, respectively. Values above σ=5.8 are related to burnt coffee.Figure 4
Reference coffee images. (a) Green coffee,i=1. (b) Light brown coffee, i=2. (c) Brown coffee, i=3. (d) Light roasted coffee, i=4. (e) Medium roasted coffee, i=5. (f) Dark roasted coffee, i=6. (g) Very dark roasted coffee, i=7.
(a)
(b)
(c)
(d)
(e)
(f)
(g)


## 3.2. Cascade Control Test

Once the learning step described above was completed using the 7 reference images, experiments 2 to 9 were carried out. Figure5 shows the colour and roasting index variations for experiments 2 to 5, where the set point of the roasting index was set to be 4.85, i.e., in the region of medium roasting coffee. The time to reach the set point in experiments 2 and 3 with an operating temperature of 475°C was approximately 40 minutes (see Figures 5(a) and 5(b)), while the time to reach the set point in experiments 4 and 5 with an operating temperature of 500°C was approximately 31 minutes (see Figures 5(c) and 5(d)), suggesting that the relation between roasting time and inflow air temperature is nonlinear, mainly because the chemical reactions that take place in the roasting are exothermic and their reaction velocities follow Arrhenius-like relations with respect to the temperature. In all four experiments, the vision system was able to detect the instant at which the desired roasting degree was reached.Figure 5
Roasting index variation in the batch process for medium roasting experiments with referenceσ=4.85. (a) Experiment 2: T = 475°C. (b) Experiment 3: replica of experiment 2. (c) Experiment 4: T = 500°C. (d) Experiment 5: replica of experiment 4.
(a)
(b)
(c)
(d)CIE 1976L∗a∗b∗ colour scale is the most common scale used to describe the colour in the food industry [19]. Castellanos-Onorio et al. [20] reported that the medium roasting coffee region has L∗ values around 24, while Vignoli et al. [21] estimated that L∗ is around 25 in this region. To assess the reproducibility of the final roasting degree using the tracking of the roasting index, the mean L∗a∗b∗ colour attained in the final product obtained for several medium and dark roasting degrees was analysed using a colorimeter (see Table 1). The mean value of L∗ for medium roasting was 23.41 ± 0.22 (α=0.05) and 17.44 ± 0.48 (α=0.05) for dark roasting. It is important to notice that the standard deviation of L∗ is below 2% with respect to its mean value, while the standard deviation of a∗ and b∗ are below 8% with respect to their mean value, suggesting that the controller reaches the same colour characteristics directly correlated with the roasting degree. Gaurav et al. [22, 23] use a L∗a∗b∗ colour distance defined as(2)ΔELab,i−j=Li∗−Lj∗2+ai∗−aj∗2+bi∗−bj∗2,which allows to compare a pair of L∗a∗b∗ colours (Li∗ai∗bi∗ and Lj∗aj∗bj∗), and they proposed to divide ΔE into five regions:(i)
If0≤ΔELab<1, the difference between both colours is indistinguishable for the human eye(ii)
If1≤ΔELab<2, the difference is only distinguishable for an expert observer(iii)
If2≤ΔELab<3.5, the difference is also distinguishable for inexpert observers(iv)
If3.5≤ΔELab<5, the difference is clearly distinguishable(v)
IfΔELab≥5, the colours are completely differentTable 1
MeanL∗a∗b∗ colour attained in the final product for medium and dark coffee.
Roasting degree
Statistics
L
∗
a
∗
b
∗
Medium roasting
Mean
23.41± 0.22
8.28± 0.49
12.15± 0.67
STD
0.21
0.66
0.64
Dark roasting
Mean
17.44± 0.48
6.32± 0.28
8.22± 0.40
STD
0.35
0.27
0.38With theL∗a∗b∗ values for experiments reported in Table 1 the colour distances can be computed and the mean value for medium roasting is ΔELab,mean=1.20±0.33 (α=0.05), while for dark roasting is ΔELab,mean=0.82±0.18 (α=0.05); therefore, the difference in the colour of the roasted dark coffee is practically indistinguishable for the human eye, while for medium roasting might be indistinguishable for the human eye or only distinguishable for an expert observer.Given that a higher temperature produces a faster roasting and gets similar roasting characteristics, the remaining experiments (6 to 9) were carried out at 500°C. The roasting index set point for experiments 6 and 7 was 5.15, while the set point of experiments 8 and 9 was selected to be 5.28, i.e., in the region of dark roasting coffee. Figure6 presents the colour and roasting index variations for these experiments. Similarly for experiments 2 to 5, the control system helps to achieve the set point of the roasting index; however, for this case, the time to reach the set point in experiments 6 and 7 was approximately 36 minutes (see Figures 6(a) and 6(b)), while the time to reach the set point in experiments 8 and 9 was approximately 31 and 41 minutes, respectively (see Figures 6(c) and 6(d)). The difference between these times can be associated to the prevailing environmental conditions that affect the inflow air characteristics. Experiment 8 was carried out on a sunny day with low humidity, while experiment 9 was carried out on a rainy day with high humidity. Even though these variations in the conditions led to different operation times, the control algorithm was able to reach the correct roasting degree, showing good robustness properties in the face of external perturbations.Figure 6
Roasting index variation in the batch process for dark roasting. (a) Experiment 6: referenceσ=5.15 and T = 500°C. (b) Experiment 7: replica of experiment 6. (c) Experiment 8: reference σ=5.28 and T = 500°C. (d) Experiment 9: replica of experiment 8.
(a)
(b)
(c)
(d)


## 4. Conclusions

On this work, the experimental implementation of a cascade control algorithm to regulate coffee roasting degree in a batch spouted bed process was presented. The use of the roasting index based on colour-matching techniques allows assessing on realtime the degree of roasting. Thus, once the reference images are available, the roasting progress can be automatically tracked and controlled without the participation of a roaster master. The experiments suggest that the proposed methodology is robust against external disturbances, such as environmental conditions and raw material.



---

*Source: 3202146-2020-01-03.xml*