TC4 + HTC roast controller for Hottop available - Page 11

Discuss roast levels and profiles for espresso, equipment for roasting coffee.
User avatar
GreenBean
Posts: 53
Joined: 16 years ago

#101: Post by GreenBean »

Thanks for taking the time to document this so thoroughly Mike. It looks very good to me.:D I hope your first roasts go well.

It will be interesting to see how well the BT thermocouple stands up to the rotating bean mass. I expect it will be fine. It is not clear from your photo how much clearance there is between the compression nut and the inner corner of the drum vane. If it is close you may wish to consider turning the inner corner of the vane down as in this photo. The drum rotation is such that beans roll over the top of the curved vane so beans do not get trapped. I have used this for over a hundred roasts without problems.

User avatar
mikepetro
Posts: 16
Joined: 11 years ago

#102: Post by mikepetro »

Thanks Tom, I am looking forward to the journey. I think I am ok on the clearance between the compression nut and the vane, a good 1/2 inch there as well. I will use your creative bend if I run into trouble. Where it cut close though was my placement of the ET probe. It is so close that adjusting the brass knob on the front of the roaster can make the difference between it bumping or not. I think an ever so slight bend of the ET probe will rectify that.

So I cranked it all up and launched Roastlogger (great app btw) and did a dry run to get a feel for it. I discovered that I had no jumper on ANLG2 (it wasnt shipped with one) so it was reading in C. I do not have a feel for roasting in C so I will need to pull the back cover off and install that jumper. Randy's HTC doc didnt really document the default or which pins to use, it just showed its existence, so I rolled the dice, they landed on C. Took me a while to find the pinout for the jumper, ended up finding it in your TC4 sketch readme, thank you for that.

Here it is if anyone needs it.
Pinout of ANLG2 port on TC4: +5V AN1 GND
Add jumper between AN1 and GND for Fahrenheit

I love the LED2 on this thing, it even works in non TC4-HTC mode. Wish I would have had that when I was figuring out the binary control of the P2.

I am anxious to try out your new PID mode. I am an instrumentation tech and have done a lot of PID work over the years. The biggest limitation of using PID on a roaster is that setpoint ramp changes are always time triggered where the roasting process is not that repeatable. Too many variables, beans, ambient temp, humidity, etc. The ideal controller would also be able to accept "event" triggers to advance the ramp step, i.e. T1 and FC etc. So far I have yet to find a PID controller that allows "event" triggers, they are all time based. I could do it with a PLC but the T4-HTC is functionally very similar to a PLC. What I would love to see is a hybrid of your action based control that allowed a PID ramp as an action. For example, in Actions after FC (and at T1) add a Temp Setpoint column in addition to the Heater % column. You could only only populate one or the other, if the Temp SP was populated then you ignore the Heat % column and use the Seconds column to calculate the PID ramp. I.e. lets assume ET is at 390F at Start of FC, after hitting the Start of FC button you ramp to 400F over X seconds stretching or condensing the FC, then after hitting the End of FC button you could ramp to 410 over Y seconds. It sure would be a great tool for controlling the rate of FC and for stretching out the time between FC and SC. It might also be useful for compensating for various load sizes, especially if you were controlling the PID off of BT between FC and SC.

Another nice feature I have seen on some Temp controllers was the ability to define different PID tuning parameters for different temp ranges. A process might behave differently between 200F-300F then it would between 380F to 400F (i.e. exothermic activity during FC). Fuji for example will allow you to autotune the PID at different temps and save 5 different sets of tuning parameters which you can then assign to specific temperature ranges. Whatever the Temp (MV) is at any moment determines which set of parameters to use.

Just some food for thought.... In any event, your app and this board will give me far greater control than I ever had before. Thank you...........
Mike Petro
Martinsville, VA
PLC/PID'd Lady Silvia, Stepless Rocky, HotTop+TC4C-HTC

User avatar
iginfect
Posts: 517
Joined: 18 years ago

#103: Post by iginfect »

Mike, I'm not following your discourse on PID mode. What I'm doing to prolong 1st crack, and am still working on this as I have different beans to roast, is lowering my heat % before I hit 1st c to about 75% a few degrees before. I learn where 1st c is from prior roasts. The log graph however gives time not temp when I logged 1st c on the graph which is frustrating me. However this still is better than the unmodded HT-P.

Marvin

User avatar
GreenBean
Posts: 53
Joined: 16 years ago

#104: Post by GreenBean »

mikepetro wrote:... I discovered that I had no jumper on ANLG2 (it wasnt shipped with one) so it was reading in C. I do not have a feel for roasting in C so I will need to pull the back cover off and install that jumper. Randy's HTC doc didnt really document the default or which pins to use, it just showed its existence, so I rolled the dice, they landed on C. Took me a while to find the pinout for the jumper, ended up finding it in your TC4 sketch readme, thank you for that.

Here it is if anyone needs it.
Pinout of ANLG2 port on TC4: +5V AN1 GND
Add jumper between AN1 and GND for Fahrenheit

I love the LED2 on this thing, it even works in non TC4-HTC mode. Wish I would have had that when I was figuring out the binary control of the P2.

I am anxious to try out your new PID mode...
I am sorry you had some difficulty locating the information on the ANLG2 jumper for Fahrenheit output. It is listed in a few posts on various forums but obviously needs to go in the next revision of the RoastLogger manual.

I agree with you on how useful the LED2 is in indicating the heater setting. I have been roasting with this indication for three years now and would not like to roast without it.

Thank you for your comments on PID control. I added the PID option to test the potential for PID control but rapidly came to the conclusion that I do not like it. I much prefer the action table approach of setting the heater and fan based on bean temperature before first crack and seconds elapsed after first crack start. The following is an extract from the post on toomuchcoffee.com introducing the PID controls:
An experimental PID and autotuner have been added to the Arduino Controller to explore the suitability of PID control of small electric coffee roasters. I want to make it very clear that these are experimental only and they may be removed from future versions of the program if they are not found to be useful.

I have very little experience of using PID control of a coffee roaster but, from my tests to date, I am not convinced that using a PID is the best way to control a small electrically heated roaster where a consistent bean mass can be used for all roasts. I believe that the current action table approach produces better control and superior roasts on Hottops and similar roasters. Despite my tests so far being unconvincing, I have decided to leave the PID in place for the time being in the hope that others will experiment with it and prove me wrong and advise how it should be used. Leaving the PID in place should not causes problems for people who do not wish to use it as, when the PID is turned off, everything is controlled by the action tables as in previous versions of the RoastLogger.

The action table approach relies on reasonable consistency in the relationship between the heater power setting and the RoR for any given bean temperature. With digital control of an electric heating element and reasonably consistent mains voltage this works very well and allows for rapid and accurate transition between one RoR and another in a way that PID control can not match, at least in my tests. I find that the PID either overshoots the required setting to an unacceptable extent, if aggressive tuning parameters are used, or takes an unacceptable number of minutes to achieve the required setting, neither of these is good for a coffee roaster. PID control would be beneficial where the bean mass varied significantly from roast to roast or for roasters where accurate digital control of the heater power was not possible such as gas heated roasters.
I suggest you use the action table approach for your first several roasts to familiarise yourself with what it can achieve. If later you find a way to use the PID controls that you believe produces better coffee then please email me so that we can discuss it further. My email address is listed in the RoastLogger Help About box and the feedback section of the RoastLogger website.

JimG
Posts: 659
Joined: 18 years ago

#105: Post by JimG »

Mike -

I am sorry for the absence of good documentation for the jumper "feature." Normally, when a US customer orders a TC4C that is preprogrammed for RoastLogger, I put the jumper in place before shipping. Sounds like I missed one :oops:

In the last couple of weeks, I have made a revision to the RoastLoggerTC4 sketch. The updated version permits selection of either F or C as the default units at compile time (one line edit in the user.h file). Version 2.1 of RoastLoggerTC4 will now toggle the temperature scale when the jumper is in place. So if a board is set up originally for F, then the jumper will switch it to C. Similarly, if set up for C then the jumper will toggle it to F.

I'll post a new download link on the project code site if folks feel like this is the way to go. Feedback?

Jim

User avatar
GreenBean
Posts: 53
Joined: 16 years ago

#106: Post by GreenBean »

iginfect wrote:... What I'm doing to prolong 1st crack, and am still working on this as I have different beans to roast, is lowering my heat % before I hit 1st c to about 75% a few degrees before. I learn where 1st c is from prior roasts....
Marvin
Marvin, The following is a copy of some early notes on controlling a roast using the RoastLogger which may be of some help:
These notes are intended as a suggested method to help you get a feel for roasting in a Hottop fitted with a TC4/HTShield or TC4C/HTC and controlled by RoastLogger. They should be used in conjunction with the more detailed notes included in the RoastLogger manual.

The Hottop heating element has considerable thermal inertia. It takes about a minute for changes in heat input to produce a more or less full output change. Due to this it is necessary to predict what is going to happen and adjust settings at least a minute ahead of time.

The default action table settings, available from the Arduino Controller menu, are based on the results of testing by the beta testers and it is suggested you use these settings for your first roasts and then modify them as you find necessary. The intent of these settings is to level off the environment temperature at a temperature that results in a duration from the start of first crack to the end of the roast of approximately 3.5 to 4 minutes. This is achieved in the following stages:

1. Turn the heater down to about 65% at about 1 minute before first crack starts.
2. Turn the heater down to about 50% 60 seconds after first crack starts.

In more detail we can rewrite 1. and 2. above as:

1. Turn the heater down to a setting that will eventually levels off the environment temperature at a bean temperature that occurs about one minute before first crack starts. The intention is that the ET is level or slightly rising a minute or so after applying this setting.

2. Turn the heater down to a setting that will maintain a level environment temperature after first crack ends at about 60 seconds after first crack starts. The intention is that the ET is level or slightly rising a minute or so after applying this setting.


After carrying out a test roast using the default settings you can adjust the settings as follows:

a) If you find that the ET levels off and you get a duration from first crack start to end of roast of about 3.5 to 4 minutes then you are in the ballpark and can make minor adjustments to achieve your desired results.

b) If you find that the ET is falling/rising significantly during first crack then increase/decrease the heater power at 1. above as appropriate to achieve level or slightly rising ET.

c) If you find that the ET is falling/rising significantly after first crack ends then increase/decrease the heater power at 2. as appropriate to achieve level or slightly rising ET.

d) If you find the overall duration from first crack start to end of roast is too short then reduce the first heater turn down temperature this will reduce the maximum ET and extend the time from first crack start to end of roast.

e) If you find the overall duration from first crack start to end of roast is too long then increase the first heater turn down temperature this will increase the maximum ET and reduce the time from first crack start to end of roast.

User avatar
mikepetro
Posts: 16
Joined: 11 years ago

#107: Post by mikepetro »

I'm not following your discourse on PID mode. .....
Marvin
Marvin, what you are doing is a tried and true method based given the control systems we have to work with. Its what I did on the P2.

What you are ultimately trying to do when you reduce the heat to 75% is control the BT ROR and slow it down. You have found through educating guessing and subsequent trial and error that 75% does the trick when you reach a certain ET. What I am proposing is that by using PID for this phase you gain a higher degree of repeatability and much less trial and error.

Evey roaster is different depending on probe type and placement, so take the following numbers as a hypothetical example only and not to be taken literally. Lets say that for a given bean you know you always hit FC at a ET of 385, using what is called "output control" (i.e. varying the output %) we reduce the heat to 75% at say 380 to extend FC. This achieves our desired result, but in process control terms it not very accurate, hence the trial and error involved.

Now lets say that I have a control system that lets me control via PID. I can then tell it that at an ET of 380 I want it to slowly increase the ET from 380 to 395 over the span of 3 minutes. The controller will then automatically use whatever output % is needed to achieve that temp ramp. I dont have to guess what output level is needed, it will control the output based on the current temp vs the desired temp. Controlling that temp is what I was ultimately trying to accomplish by varying heat % but this does it much more precisely.

When I PID'd a Cafe Gene I was able to taste this level of control, but what hampered me was that it would not let me manually advance steps to the next ramp, it was limited to only changing steps (new temp settings) based on time. I learned that time triggers alone would not suffice for adequate control. In other words I had to predict exactly how many seconds it would take to reach an ET of 380 if I wanted to slow FC down. The time to 380 just isnt repeatable given the variables of bean, ambient, temp, load size, etc. Thats why PID "alone" is not a good solution.

Roastlogger uses a combination of Temp based triggers, and time based triggers which is fantastic compared to the manual B2 or the binary output control used by the P2, but you still have to guess/experiment what output % will achieve your desired temps. Off the shelf PID ramp controllers use time based triggers only but they control the temp precisely. What I crave is a combination of the 2.

What I really desire is a system that will let me program a series of ramps, with the advance to the next ramp being triggered by my choice of time, temp, or a manual input (a button press). Whether to use ET or BT for the trigger would require experimentation. Ultimately we are trying to "control" the BT, but I have heard from others that trying to directly control the heater % based on BT leads to less than great results because of wide swings in ET due to the huge thermal lag in the electric heater.
Mike Petro
Martinsville, VA
PLC/PID'd Lady Silvia, Stepless Rocky, HotTop+TC4C-HTC

User avatar
mikepetro
Posts: 16
Joined: 11 years ago

#108: Post by mikepetro »

I much prefer the action table approach of setting the heater and fan based on bean temperature before first crack and seconds elapsed after first crack start.
I totally agree that PID "alone" will not work good for an electric roaster. If forced to choose between the two methods I would (and indeed now do) choose the action/time based method. But I also believe that PID has its place at certain times during a roast, and that it can be appropriately tuned for those specific times. The challenge is that it is an "all or nothing" situation in most controllers that I have seen to date, short of the really expensive industrial stuff. I actually considered using a small PLC to control the heat, i.e. use fixed output control at times and use PID control at times. Dry the beans at a fixed output for a fixed time, then heat up to a fixed temp just before FC as fast as the machine can, then let PID take over through most of FC, then switch back to a fixed output till drop.

Just thinking, can RoastLoogger switch between Action based mode and PID mode on the fly? Or is a restart required?
I find that the PID either overshoots the required setting to an unacceptable extent, if aggressive tuning parameters are used, or takes an unacceptable number of minutes to achieve the required setting, neither of these is good for a coffee roaster.
I was able to overcome this effect with a Fuji controller when I PIDd the Cafe Gene which has a similar issue with thermal lag, although not as severe as the Hottop (coil vs rod element). The Fuji let you store multiple sets of tuning parameters called "PID Parameter Groups". It would automatically select the Parameter group based on the current setpoint. I used one group for the drying phase, another group for the ramp to FC phase, another group for the exothermic FC phase, and yet another for post FC. It worked pretty well if I guessed the time to FC right, but change the ambient temp by 10 degrees and that time estimate no longer worked. Thats why I gave up on PID with that roaster.



My theorizing aside, I am extremely grateful for the the solution that you and Jim provided. It is by far the best and cleanest solution I have seen to date. Jim gets somewhat compensated for his work, I cant even find a "donate" link on your page. Please dont take my going down the rabbit hole as a lack of appreciation for what you have made available.

May all your roasts be "God Roasts".........
Mike Petro
Martinsville, VA
PLC/PID'd Lady Silvia, Stepless Rocky, HotTop+TC4C-HTC

newdouga
Posts: 1
Joined: 11 years ago

#109: Post by newdouga »

I'm brand new to this forum and relatively new to home roasting, in search of that illusive perfect cup of coffee. I'm replying to the post by mikepetro on Feb 3, 2013. I am a big fan of PID control because I am all about accuracy and repeatability. I spent several years in a former life designing PID temperature profiling controllers for DOE research projects. I just got my roaster PID going a week ago and am in the process of fine tuning my profile (roasting Ethiopia Sidamo). I let the PID (REX-100c) do an auto tune and it came up with some surprising but effective parameters. Understand that my popcorn popper uses a coil type heater. As such, it is very responsive to power changes so the thermal lag is short - that's a good thing for PID control. You want as short a lag between the heat source and the sensor as possible to minimize overshoot or even oscillations. I am running a proportional band of 4 degrees C, integral reset of 1 second, derivative turned off, and an interesting parameter called Anti-reset Windup set to 100%. So what does all this mean and how does it apply to a coffee roaster?

Any proportional feedback control system is going to hunt for the set point. The degree of hunting, overshoot-undershoot, and final temperature depends on the heating power available, the thermal lag between the heat source and the sensor and the gain of the system. The first two variables are set by the design of your roaster, the placement and mass of the feedback sensor, and the thermal load (coffee beans). Because there must be an error between the set point and the actual temperature in order to create an ON signal to the heater, a straight proportional controller will never achieve the set point exactly. Hence, you want as high a gain (narrow proportional band) as you can get by with without causing the system to overshoot wildly or go into oscillation. For my air popper roaster with a quick thermal response heater and close coupled sensor, the auto tune program came up with the 4 degree proportional band.

The Integral control term is design to remove the error between the set point and the actual temperature by calculating the sum of the difference between the set point the the actual temp over a period of time and adding that sum to the error signal thereby closing the gap between the set point and actual temp. The integral term will grow until the error signal goes to zero. If the integration time is long relative to the natural response time of the system, then the integral term becomes a significant portion of the error signal if not the entire portion. Then when the integral reset happens, the actual temperature will drop as the proportional term takes over. This is not such a problem when the temperature is at the set point, but can be a big problem during the ramp up phase when the error is very large. Bottom line, keep the Integral reset term as small as possible to achieve stable performance. My auto tune program set I=1 (1 second) which seems appropriate given the rapid response time of my roaster. The Anti-reset Windup parameter is designed to deal with the integral reset issue by creating a sort of memory for where the integral term was prior to the reset. My auto tune program set this parameter to 100% of the proportional band. I am not exactly sure what this means yet so I won't comment on it.

The last term, derivative, anticipates the change in temperature versus time as the actual temp approaches the set point. The rate of change in temperature is calculated and applied to the error signal to effectively slow down the ramp rate and avoid overshoot. This term is important only if you have a long thermal lag between the heat source and sensor. Roasters with a rod type heating element would fall into this category. I takes a long time for the rod to heat up when power is applied, and an equally long time to cool down when power is removed. As a result, the system will oscillate (overshoot and undershoot) in the absence of a Derivative term, especially if the proportional band is too narrow (high gain). My auto tune set this parameter to 0.

I ran the auto tune program under the following conditions: Pre-heated the roaster to170 C, added my beans, waited until the temperature dip bottomed out (about 120 C) and then started the Auto tune routine. I agree with the comments regarding multiple auto tune programs. There most likely will be subtle differences in PID parameters depending on what phase of the roast you are in. On the other hand, with PID parameters like mine (4,1,0) there is not a lot of room for change so it may not be significant. In the absence of an auto tune routine, I recommend the following approach to setting the PID parameters:
1. Start with the P term (all others set to zero). Set the proportional band to 2-3% of the target set point. Turn the system on and let it ramp from ambient to the set point observing the overshoot and undershoot (you really should do this with a bean load so it could get expensive). Cool your system and repeat the test, narrowing the proportional band until an overshoot of less than less than 1-2% of the set point is achieved. For example, with a set point of 170c, set the P term to 5 degrees. Run the ramp test and narrow the P band each time until you achieve an overshoot between 1 and 3 degrees.
2. If you have trouble minimizing the overshoot at P = 3%, try adding in some Derivative term, a little at at time until the overshoot is minimized. A little dab will do ya so don't over do it.
3. Finally, apply the Integral term, again a little at a time, until the system reaches the programmed set point but remains stable. Start small and increase the Integral term just enough to cause the temp to settle at the set point in just a few seconds of entering the proportional band.

PID control is not the answer to all problems - but it does have its place. PID is good for hitting and maintaining a target temperature. It's not so good at hearing the audible queues or smelling the aromas of roasting coffee beans. I think the ultimate system would be an experienced craft roaster with their hand on a large temperature dial and a well characterized PID in the background responding faithfully to his/her every command.

Happy roasting,
Doug

JimG
Posts: 659
Joined: 18 years ago

#110: Post by JimG »

A quick update on the HTC boards.

In the original version, a short 4-wire cable was required to make the fan and heater control connections between the HTC and the TC4C. The HTC has been modified so that mating male/female headers make these connections when the boards are stacked. The short 4-wire cable is no longer needed.

Also, I now have materials needed to build longer versions of the 8-wire OEM Hottop control cables. The longer cables allow you to mount all of the new electronics for an HTRI system outside the roaster if that is your preference.

Jim