Wilson's Coffee & Tea
3306 Washington Ave.
Racine, WI 53405
Our Hours:
Monday–Friday
6:30–6:30
Saturday
7:00–6:00
Sunday
10:00–4:00
Established 1991

Software and Coffee Tastings

21 June, 2008

Today we held a small coffee tasting at the shop. Thank you, Anacafé, for providing the samples for this event. At this event, we had one coffee from each of Guatemala's eight major growing regions available for tasting along with some information about each region and about Guatemalan coffee in general. The favorites were the Volcanic San Marcos, the Rainforest Coban, and the Acatenango Valley coffees. We will be having another tasting of Guatemalan coffees featuring a number of coffees from Antigua next week.

If you have visited us recently while I was roasting, you may have noticed a computer in the roasting area. This has been running an automatic data logging application I wrote. While far from finished, the program has reached a point that I am comfortable using it daily for both production and profile development roasts. As a result, I am releasing the source code for Typica 1.0 (hosted elsewhere because our hosting agreement says we can't host software).

Features of Typica

Typica is built to support the way I roast coffee on our production roaster. It provides two timers (batch and maintenance), a temperature indicator, a table capable of displaying time, temperature, and annotation data from the current batch and a previously saved target profile, a graph displaying the same information, and a set of buttons for starting and stopping the data logging functions and adding common annotations.

Data can be saved in an XML that can be read back later or as CSV to work with the data in other applications.

Typica is not a roast control system. The person using it must still make all of the control changes. The focus of the software is maintaining a record of what has been done without burdening the person roasting the coffee with the mechanics of keeping such a record.

While more of the user interface is hard coded than I'd like, an effort has been made to keep the program source code simple and easy to understand. The use of CWEB allows anyone to download a PDF with the source code documentation and read it like a short book. Extensive cross references, a table of contents, and an index makes finding code easy.

Our configuration

We have two coffee roasters set up to use this software. The production roaster, a Diedrich IR-12 Deluxe manufactured in 2000, and our sample roaster, a Diedrich SR-1 manufactured in 2005. The sample roaster was only modified yesterday for this, so the controls in the program are more closely related to the controls available on the IR-12. The thermocouples from the roasters are connected to a National Instruments USB 9211. This is then connected to the USB port of a computer. Most of the time this is my MacBook Pro, but when I am out of town I bring in a Mac Mini. The program is mainly developed and run on Macs, but there shouldn't be any Mac-isms in the code. It should compile and run fine on recent versions of Linux and Windows.

How I use Typica

When a new coffee comes in, I roast at least one small batch of it, recording profile data, airflow control, and when I pull samples. I'll collect up to 15 samples from each batch. Typica has a New Sample button that creates an annotation in the log with a sample number connected to the time and temperature at which the sample was taken. The log is saved for future reference.

The next step is cupping all of these samples. I usually find what I want in one of them, but sometimes I will repeat the above process, collecting samples in a narrower range of temperature, changing the airflow pattern, or changing the rate of temperature change in certain temperature ranges until I find what I want from the coffee.

Once a good sample is identified, I load the data recorded during the batch that produced the sample. I then roast a batch of coffee with the goal of duplicating that sample. I save the data from this batch for future reference. Once the coffee has rested, I brew a pot to verify the results. Assuming the coffee is good, I use that data as a target profile for future batches.

I keep a target profile for each roast we produce and profiles for lots of coffee we are sold out of are archived where they won't cause confusion.

Tools Used to Build Typica

The only way I am distributing Typica is in source code form. I am not providing a binary version for any platform. Anybody who wants to try the program will need a few tools to create a machine executable program from the code.

Typica is written in C++, but it does not look like most programs written in that language. Most programs are written first for the computer with the humans who want to understand the program a secondary concern. Typica was written with humans in mind first. A program can convert the source code to a form the compiler will accept. This is done with the CWEB System of Structured Documentation. One program, ctangle, reads my source file and produces code for the compiler. Another program, cweave, reads the same file and produces documentation for TeX.

This documentation includes diagrams generated by METAPOST. A program called pdftex takes the documentation file and the graphics to produce a nicely typeset PDF.

Typica uses Qt for many things. For some of this, additional code is required. A program called moc is run on the file produced by ctangle to generate this code.

My normal workflow when changing the program is to use Terminal running bash to generate the updated files while Preview displays the PDF produced and XCode displays the source file. A project file produced by qmake allows me to compile and run new versions of the program.