Saturday, May 17, 2014

Taking Control

Taking Control - PID Settings and Roasting Controls

FOR YEARS, THE QUESTION OF ROASTER CONTROLS has been a source of contention within the modern coffee roasting community. How much control is too much (the law of diminishing returns?), and how little is too little (do you like fl ying by the seat of your pants?). These are just some of the questions that are batted back and forth by coffee roasters. Moreover, questions about control often lead to discussions that get to the heart of coffee roasting--is it a creative art or a systematic science?

Professional roasters and hobbyists alike have debated control questions ad nauseam. It seems to matter little whether an adherent to one school or another is working on a tabletop or a four-bagger; there are proponents of each approach in every roaster size category.

Often, the discussion degenerates into a West Side Story-style face-off of backhanded compliments, posturing and outright demagoguery. Many times those with the loudest voices, longest careers or most impressive resumes win by default or through intellectual intimidation. The craft adherents accuse the "technology geeks" of being trapped in a futuristic fantasy where HAL will one day handle all aspects of the roasting process. Likewise, proponents of the coffee roasting as pure science school accuse the craft roasters of being neo-Luddites attempting to bar Darwin from entering the roastery door. Although it can be quite entertaining to listen to hardcore partisans of both schools espouse their orthodoxy, it is rarely, if ever, very informative.

Proportional Integral Derivative Controllers

One of the biggest control discussions in the coffee industry lately has revolved around proportional integral derivative (PID) controllers: logic-based controllers that allow the user to input temperature set points, and infl uence the logic. The PID's ability to control heating functions is well known but not well understood by most coffee professionals. Happily, roasters and baristas alike are trying to figure out how to use these tools to better control their respective processes.

Most new coffee roasters delivered today have at least a simple PID controller installed as standard equipment, and many come with fairly sophisticated PID profiling controllers. Most roaster operators, however, have no clue as to what PID stands for or, more importantly, how to use this technology to their benefit.

Those who don't understand the technology may use their PID controllers for set point controlling, or simply as digital temperature readers. When roasters use a PID as a set point controller, they input a set point in their controller and allow the bean or air temperature to rise to that point at which time the controller either sounds an alarm, shuts off gas to the burner or both. Although this can work very well and is a great improvement in controllability, repeatability and safety from the stopwatch and trier systems of the past, it is in fact an underutilization of a PID controller.

A properly set PID controller, with a controllable gas train, can help make coffee roasting a much more exact and repeatable process, thereby freeing the roaster to work on other elements of quality control (namely green coffee and blending) that are so essential in the creation and sustainability of great coffee.

Not all roasters will choose to use PID controllers for the roasting process, and that is their choice, as it should be. However, in order to make a valid choice, a roaster must understand existing technologies; what they can and cannot do for their businesses. A choice made without evaluating all available information is a gamble, and why gamble with good coffee? This article attempts to clarify some of the mystery that surrounds PID controllers and to look at what one roastery was able to do with one roaster in one installation.

PID Basics

So what does PID mean? What is a PID controller? What is the difference between a PID controller and PID profiling controller?

PID logic control is used in many of the better off-the-shelf digital controllers (Watlow, Omron, Honeywell, Siemens, etc.) and most, if not all, proprietary coffee roasting control systems produced by roaster manufacturers.

PID controllers make mathematical calculations to help keep the actual temperature as close as possible to a desired set point temperature. In the case of coffee roasting, the set points are generated along a positive sloping curve. If the PID settings in a PID array are incorrect, then the system will either be constantly running to catch up to the desired curve, or constantly overshooting and undershooting as the controller attempts to bring the actual temperature to the set point.

A fully functional PID controller will generate set points regardless of whether the PID settings are correct (See Graphs 1 & 2, pages 58-59). For the roaster, the trick is to find the correct PID settings for their roaster in its installation. The proper use of PID controllers is the next logical step up from manually profiling coffee through manipulation of the existing time and temperature curve. A roaster's existing time and temperature curve is the curve that naturally occurs when a single piece of roasting equipment in a set environment is roasting a particular coffee, and no changes are undertaken by the operator until the end of the roast.

So the question becomes: how do you find the correct PID settings for your roaster and its control system? For most roasters, using a PID controller with a ramping (ramp and soak) or profiling function, the PID settings will be different than those used by most proprietary roasting programs. In most cases, off-the-shelf controllers will require a slightly more aggressive P value and I value, while the D should be set to zero for coffee roasting. Many PID profiling controllers contain auto-tune functions that attempt to assist with PID settings. It has been our experience however, that auto-tuning functions do not work well for setting PID values for the coffee roasting process.

To properly set PID settings, it is imperative to understand what each part of the PID acronym means and its effect on the logic used to control the heat input:

(P) P, or more accurately, proportional, is the part of the logic that dictates how aggressively a system will try to acquire the set point. The larger the P, the faster the controller will ramp up temperature. If, for example, you set a P value of 1, it will reduce heat input as it climbs toward the curve so that it will gradually intersect. If the P is 50, the output will be more aggressive. The output will remain at 100 percent until very nearly reaching the point of intersection.

In other words, P defines the distance at which your foot comes off the gas as you approach a line of traffic. Remember, the larger the P, the more aggressive the control system and gas train are (See Chart 1). If P is too aggressive, it will supply energy up to the point of intersection and then drop immediately to zero percent output. In a process like coffee roasting where much of the energy is retained and the product itself will begin to go exothermic, an aggressive P will often overshoot and, depending on where in the roasting process this occurs, may eventually fall behind the curve, causing the control system to constantly chase the desired profile curve (See Graph 1, page 4).

(I) If P is your gross adjustment on your control system, then I is the fine adjustment. I, or integral, is the value inputted to raise the temperature slightly so as to attain set point: the gain. I values work in an inverse relation to the P values. The larger the I, the smaller the gain, the smaller the I, the larger the gain (See Chart 2). Because I is the fine adjustment, I should not be adjusted until the P value is set. Too much I (low number) will cause the system to be unstable around the set point, while too little I will lead to proportional droop, when P is correctly adjusted (See Graph 2, page 59). Good control of the process is a function of PI.

(D) Finally, there is the D, or derivative, value. Derivative is the value that is used to dampen oscillations about a set point. It is in essence a "super fine" or squelch adjustment. In our experience, if a controller utilizes a bean probe for actual temperature control, then there is no need for a derivative value. However, if a roaster is using environment temperature to control the process, then a derivative value may be desirable.

The graphs used in this article rely on bean temperature as the temperature to be used in controlling the function; environment temperature is logged only and not used for any calculations, and therefore the graphs have a D value of zero.

Charts 1 and 2 list different P and I values and their relative effects on output.

Let's first look at P settings.

P VALUE I VALUE Temperature difference when output starts to be less than 100%
1 0 99 degrees
10 0 10 degrees
20 0 5 degrees
30 0 3.4 degrees

What does this mean? If you look at the temperature difference value of a P of 20, the difference is five degrees, which means that the output calculated will be 100 percent if the temperature difference is five, 50 percent when the difference is 2.5 and zero percent when the difference is zero. So over the five degrees difference, the output will be scaled anywhere in between.

Now hold P constant and add different I values.

P VALUE I VALUE Output percentage at 2.5 degrees difference
20 0 50%
20 20 50.09%
20 10 50.18%
20 0.5 53.6%

This shows what kind of gain the I value provides. The output calculated is not as simple as shown here. The complete calculation is based on elapsed time between calculations, how the temperature is responding to the output, how fast the temperature was rising/falling, etc. PID calculations are not easily understood. However, hopefully this will provide you with better insight as to what changing the settings will accomplish.

A Test Flight

So much for the science (or attempted explanation thereof). What are the practical effects of PID settings in programmable controllers, and how to read and set them?

As most experienced roasters know, the actual act of roasting coffee is a fairly simple undertaking. Turning the coffee from a certain shade of green to a certain shade of brown seldom rises to the level of rocket science.

That said, choosing which beans to roast to what level and the profile to be followed to bring the most out of each and every coffee, each and every time, can sometimes rise to the level of pure magic. Like magic, consistent roasting takes an intimate knowledge of the equipment used, a high degree of technical excellence, continuous practice and an open mind. Accepting technological change takes an open mind.

To test and set our PIDs, we did extensive research on a 15-kilo Ambex coffee roaster retrofitted with the Profile Plus DCQ system. The equipment operates on natural gas, has a total exhaust length of 27 feet with (1) 90-degree angle at the base of the roaster and ending in a "no-loss" stackhead. All roasts were conducted in a hands-off manner (that is, once PID settings were made and the roast started, there was no human intervention). All roasts were subsequently cupped for quality. All data (including all roasts conducted since October 1, 2004) have been kept and are reviewed against subsequent changes in atmosphere, green coffee crop and periodic roaster maintenance. Much of the initial PID research was compiled by Paul Ribich for the SCAA's upcoming Coffee Roaster's Handbook. The graphs used in this article are actual roasts taken from the data log files and shown in the log reviewer format.

Graphs 1 and 2 are actual examples of what happens when PI settings are incorrect. Graph 3 is an example of correctly set PI values for a roasting process. The following graphs display three data lines: desired profile (set point) in blue, environment temperature path in orange and actual bean temperature profile in green (graph legends on right of graph).

In Graph 1, it is easy to see what occurs when a P value is too large. The overly aggressive proportional function causes the actual temperature (bean temperature) or green line to overshoot the desired profile/set point curve (blue and purple) three successive times. Not only is the bean temperature generally above the desired profile curve, it has produced its own distorted (and undesirable) profile curve. In fact, the green line appears to almost "bounce" from line to line as time progresses. The correction to this problem is to reduce the P value until overshooting is alleviated.

Graph 1graph_1
Graph 2
graph_2
Graph 3graph_3
Graph 4graph_4

In Graph 2, the gross overshooting or bouncing of the green line has been virtually eliminated. However, upon closer inspection, it is clear that the bean temperature, while maintaining the shape of the desired profile curve, consistently tracks below the blue and purple of the desired profile. While many roasters would be very pleased with a time and temperature curve as close to target as this, it is actually possible to shift or "gain" this droop away by adjusting the I setting. What is needed in this example is a more reactive I. A faster integrating action can be acquired by using a smaller I value. The correct I value will, in effect, offset the droop of a correctly set P.

Eureka! Graph 3 shows what happens when PI values are inputted correctly. Set Point and Bean Probe lines are married up from start to finish. The Profile line is acquired at Hold Temperature, and all three lines track consistently from that point forward. Not only is the desired roast time and temperature reached (within a five-second window), but the integrity of the desired profile is maintained throughout the entire roasting process.

Kathi Z's Magic Trick

The final graph, Graph 4, is of a one-pound roast in a 15-kilo roaster. Kathi Zollman, roast master for New Harmony Coffee & Tea, by experimenting with PI settings, consulting Paul the engineer, and adjusting initial drop temperature, was able to get a one-pound roast to follow a pre-set profile, a feat that even the manufacturer thought impossible. The inability to control a small fractional batch in a drum roaster has long been a problem, even for experienced roasters. To get a small batch to actually follow a large-batch profile was considered pure magic.

A closer inspection reveals how the environment temperature (burner) was constantly adjusting to keep the bean temperature on the desired profile. Although this roast, like the others shown, was accomplished with a hands-off technique, it required an experienced roaster utilizing all her talents to ascertain and input the correct settings. Such things as total energy present at start of roast; energy acceleration and bleed rates; responsivity of controls; accuracy of temperature readings (bean temperature); changes in conduction and convection ratios; and the green coffee itself (hard bean, soft bean, old crop, new crop) all played a part in determining the PID settings and the desired profile. Like a good magician, Kathi just made it look easy. (As an aside, the coffee cupped admirably as well.)

Expanding the Realm of Possibilities

As an industry, we are entering a time when new control technologies are becoming more widely available and cheaper. This, coupled with the exchange of information being fomented by the rise of the Roaster's Guild, online coffee roasting bulletin boards, and more technically oriented and focused trade journals, are increasing the level of professionalism of the specialty coffee industry and expanding the realm of possibilities for those of us who have committed our livelihood, and lives, to this industry. As to the question of whether coffee roasting is art or science, it has always been both. A good roaster needs the intuition of an artist, the work ethic of a craftsman and the inquiring intellect of a scientist to truly become a master.

PAUL RIBICH is the process engineer for Ambex, Inc. He has a BS in mechanical engineering and an AAS in mechanical engineering technology and is a former team leader of advanced processes at Watlow Electric's Temperature Sensor Division. Paul is a member of the Roasters Guild who changes his own oil and is an avid woodworker.

HANDS - ON CONTROL

BY KATHIZOLLMAN

I consider myself an experienced roaster. After seven years of roasting, I'm comfortable with my baseline knowledge and my understanding of the roasting process. However, I'm finding that today's coffee roasting environment is one of constant change. The craft is being immersed with science, offering us new ways to unravel the mysteries of roasting, such as what really happens to the green coffee during the roasting process.

The primary concepts I learned in Coffee Roasting 101 are important in understanding the fundamentals of the roast, and it's this base knowledge that gives me a level of comprehension as I turn my focus to new ideas and concepts of control like PID controllers.

For years, I used a digital timer and temperature probe to achieve consistency in my roast profiles and had satisfactory results. But I found that I had to move out of my comfort zone of familiar techniques and terminology to learn the new skill of controlling the roast with PIDs. While this was an intimidating endeavor, my newfound roasting skills and working knowledge of PID controllers (although limited) has been rewarding and exciting.

I feel that learning the scientific language and mastering the basics of PID controllers provided me with a new level of expertise. When I combine this new science with my craft, I have a new roasting tool that helps achieve a controlled path to the completion of each and every roast.

Today, I control my roaster environment and the manner in which my roasts progress to the desired drop point through the logic of the PID controls. This allows me to look beyond time and temperature as the main components of the roast profile. With the PID, the S-curve becomes my tool for discovering the best path to a desired roast. To determine the most desirable roast profile, I cup various profiles of the same coffee roasted to the same degree. I alter the S-curve of each trial roast for an aggressive start or a gentle curve, for a shorter or longer rest period. When I cup the varying profiles against one another, I find that the path taken to the drop point changes the cup characteristics of each coffee, that the path itself is as critical as the time and final temperature.

Initially I was overwhelmed with the entire concept of control and PID and, had I been a rookie, it could have been setback for me. Still, I attempted to break the process down to its simplest form, making this foreign concept not quite so overwhelming.

I learned that the P of PID means proportional; I find it's easier to remember as "power." The amount of power I apply to the roast to reach the desired temperature in a pre-designated time frame. The higher I set the P value, the faster the temperature climbs. If my initial P settings are too high, the profile path is overshot and it's difficult to slow the roast down and regain control.

Once I get the P set so the roasting profile is followed consistently, I rely on the I, or integral, setting to fine-tune the roast profile. The I setting provides output boosts to keep the roast on track when the prescribed P setting isn't maintaining a smooth path. I settings can be confusing, in that the higher the I value, the smaller the gain, while a low I value provides a greater output.

With the control system I have in place, I don't even have to use the D, or derivative, setting. I'm able to have enough control without adding the additional variable.

It takes time and patience to establish accurate PID settings for desired roast profiles, but once the setting are locked in, very little additional tuning needs to be done.

Now that I have PID settings in place, I can accurately duplicate roasts on an ongoing basis. I was surprised to learn that weather conditions such as barometric pressure and temperature have less of an effect on the process of the roast than when I attempted to control the roast manually. To compare my roast results, I pulled up roast data graphs of the same coffee profile roasted on four different days (one day near freezing, one day 80 degrees, one rainy day and one overcast day). All four roasts shadowed one another within a three-degree spread. Graph 5 shows roast profile data from four different roast days, all four being the same coffee and same profile. The top four thin lines show the environmental temperature in the roaster. It's evident that the system was working hard to maintain the profile by looking at the range in temperatures. The wide lines represent the prescribed profile and the actual profiles of the roasts. The lines aren't clearly visible, but there are eight lines grouped together showing the path each roast took.

Graph 5graph_5

These graphs support the idea that roasters can replicate the roast process accurately and consistently with PID controls, without having to reset perimeters when external variables change.

I've also discovered that PID controllers allow me to use varying charge weights of green coffee and follow the same profile, without resetting the roast perimeters. Again, the science provides consistency for me as a craftsman--within a controlled roasting environment, I can roast a 12-pound batch of coffee with the exact profile as a 24-pound batch, with the same results.

I encourage roasters to invest the time and brainpower to learn how to use PID settings as a tool. It's habit-forming, and I find I always want to try something new or make a slight change, just to see what happens. The applications seem endless to me. So many roast factors can be changed or experimented with to roast the perfect coffee and to create a roast style unique to each roaster.

KATHI ZOLLMAN has been in the specialty coffee business for 10 years. In October 2004, she joined the PID team and became the roast master at New Harmony Coffee & Tea in Clearwater, Fla.

No comments:

Post a Comment