It's a HID device, you don't need drivers. Victor protocol - sigrok
There is a lot of activity in technology-driven roasts at the moment. So here's my effort.
I managed to do a sub-optimal roast with my corretto the other day and I don't really know why, so I decided I needed more control. Since I'm a Linux nerd, I opted for my Raspberry-Pi.
The design principles are:
- USB thermocouple
- preheat facility
- auto control of heat during roasting
- heat profile from key-point-only text file
- log file and graph to be available via web
Since the CS thermocouple doesn't have a Linux driver, I've had to do something else - watch this space.
Here's some photos:
Last edited by gonzob; 3rd January 2014 at 01:23 PM. Reason: spelling
I've been using an Arduino with a thermocouple shield for a couple of years now hooked up to my android phone. Looking forward to seeing how roast-pi works out. My pi is doing xmbc duties at the moment.
looks good work. i suppose you can do software updates fully wirelessly?
are you planning to include a ramped PID control loop for the heating?
keep us posted
@Hildy, wasn't sure it would work with *nix so I opted for a Yocto-thermocouple. Nice units, bit pricey, but able to be driven in a plethora of languages. I'm running a simple bash script. Just waiting for delivery of that now.
@brett, yes, I do all the programming remotely. My current plan for the heating is to input the profile thus:
I input only the key points. So, up to 60C at the 2-minute mark. 130C at 6 minutes. Slower rise to 160C. Steeper rise to 1st crack (approx) at 15 mins and 190C, then slow rise to 210 at 20 mins and finish. The last line simply tells the system that the roast is over. I can put in as many intermediate points as necessary. The program straight-lines between points to get the target temp at any time.
Heat control?? Well, I'm not planning to use PID. I don't think it's necessary. The temperature movements seem fairly slow. So, I'm using slow bang-bang control and simply switching the heat gun off when the temp gets above SP. My heat gun is a Ryobi EHG2002LED with a manual control of the max temp. So, my plan is to manually set that only as high as necessary to meet the max temp rise, and automatically switch the whole thing off if it gets too hot. Of course, I can use PID, but it means pulling apart my heat gun. I'll try it without first.
My first computer-controlled roast has been completed.
See attached pics.
1. The equipment layout
2. The internals of the Roast-Pi with the new Yocto-Thermocouple board attached
3. A close-up of the Yocto-Thermocouple. That's a micro USB connection. It's tiny! So was the type-K thermocouple (see the really thin white and green wires?). I had to make a sleeve and mounting for it.
4. The roast profile. Things to note: the preheat temp was 100c. Initially I didn't have the temp limit on the heat gun set correctly, and the rate of climb didn't match the profile. After I fixed that, the bean temp closely followed the profile with the heat gun switching on and off (you can see the ripples).
From here... I didn't think the heat gun would turn on and off as often as it did, so I'm going to put in some pulse-width-modulation. Maybe just 3 settings: full-50%-off
Generally, I'm pretty happy, except that when I removed the basket I forgot to withdraw the thermocouple, and bent it a bit. Doh.
Nice! Any plans to release some of your work? I have a beagleboneblack sitting here doing not much - I have plenty of Arduino experience (well actually mostly bare metal AVR in C language) and something like this would be a good way to get into the linux dev type stuff.
I have a spare breadpan which I dropped (doh!) and spent a ridiculous amount getting a new one which hasn't really been used. Don't want to destroy my breadmaker, but can scrounge up some parts to use the old one
Schmik work. I add sleeve insulate to the K type with just the bead and approx 2mm of bare wire exposed and flexibly mount it vertically in the "homemade lid" of the roaster and down into the bean mass so I theoretically I cant forget to remove it prior to dumping the beans into a cooler. The thermocouple flexes in the direction of bean flow to avoid paddle and basket contact, still in the early days of my roaster project though. No real auto control as per gonzobs excellent set up as yet.
@nicovington, yeah, happy to share the code. I hadn't seen the beagleboneblack before - looks interesting. The roast control is a bash script which outputs a text file. The text file is read by a php script and is available from the Pi Apache server. The php script plots the roasting graph live, so I can watch it on my phone, and then come back to it later for review. The graph is generated using the Google graph application, which was really simple to set up. Send me a pm and I'll forward the code. It's a bit big to put on here.
@noonar, if you have a look at my lid, there's a little hole on the left side where I normally poke a TelTru thermometer to monitor the roast in the way you suggest. Unfortunately I can't do the same with the thermocouple, as I like to take the lid off to have a look, and that would upset the control.
I'm doing some simple PWM stuff now, but I already have enough roasted coffee for a while, so I won't be roasting again for about a week.
Well, it wasn't a week later.
I installed a new heavier-duty (6mm stainless sleeve with braided line) thermocouple and put in some heater PWM when the temp is within 2 deg of the setpoint (this assumes that the heat gun is always set to a temp higher than I'm ever going to need). The results are a smoother curve because:
- the larger TC has higher thermal mass and therefore smoothes the temp changes more
- the PWM smoothes the peaks of the ripples
I took the lid off the basket just at the end to check the bean colour, and the temp dropped a couple of degrees before I pulled the roast. The lid has quite a large effect.
Last edited by gonzob; 11th January 2014 at 09:37 AM. Reason: Stupid site changes second crack to second crack!
Yep, the Lid has a very marked affect on heat retention. It is very worthwhile to make up a "Trier" using a long-handled teaspoon with the spoon section bent at or near right-angles to the handle. Saves having to remove the Lid until you're ready to dump the batch into the cooler...
Now for the ROAST FOTEK...
It's a long story, but here's the abbreviated version:
- a certain CSr decides to play with PWM
- same CSr buys $20 XU1 heat gun because he doesn't want to pull apart the good one
- separate DC drive to fan made
- in the middle of testing the XU1 (cheap, disposable) disposes of itself and takes the Fotek SSR with it
- CSr's self esteem takes a hit.
Funny story, at least you have the spare heatgun ready to go.
I ended up replacing the Fotek relay in mine with something else as it doesn't work properly with PWM frequencies.
I then tried to use it as a simple on/off relay for the stirrer and found it would not stay on steady, after a while it would pulse and carry on.
Thinking it may be faulty, I tried another which behaved the same so out with the Fotek relay for me.
I didn't have a problem with the Fotek. You're right about turning on and off frequently, but it works OK for everything down to about 0.03sec pulses. I've just ordered another off EB. Let us know what you decide on using. I'm running mine straight off the PiFace I/O board, so I wanted something with a bit of isolation.
Nice one Gonzo, thanks for sharing the heat gun warning.
It does look like poor design, surely the active terminal could have been positioned in such a way that it does not make contact with neutral line should it come loose or move but then again these things are not designed to be serviceable.
Just out of interest, what damage did that short do to the gun? I would have thought it would have just tripped the mains circuit breaker.
The circuit breaker went, but the Fotek SSR had been fried by that time. Then I tried turning things on one at a time (I initially thought the agitator motor had gone bang). So, when I turned on the heat gun for the second time, it finished off the temp cut-out, which is non-serviceable. I briefly thought of running the gun without the o/temp protection, but it would have involved fiddling with the wiring, riveting (too hot for solder), etc., so I retired gracefully.
I now have an 18VDC cold-air blower with nothing inside the heating tube.
There's been a bit of development...
I bought another heat gun, this time a Ryobi 2-speed 2000W. I ripped out the fan speed control, and used a laptop power supply to drive the fan.
I wrote a PWM control in Python with a cycle time of 1 sec, varying the heat using the solid state relay.
Next I did some testing and discovered that there is about a 45-sec lag between changing the input power and seeing the result in the beans. Note that this is for my setup only - yours may be different. I measured the "gain" and cooling times, and programmed that into the control.
So, now I have a system that:
- looks at the current temp every 5 secs
- looks ahead and calculates what temp will be required in 45 secs
- allows for cooling (dependent on current temp)
- calculates an input power (as a % of maximum) to achieve the 45 sec target
- plugs that into the PWM program
- trims the "gain" depending on how well it has achieved the current temp.
- plots the power% on the graph
The result of my first run is attached.
- I started with the gain at a low (safe) value, and it took some time to trim itself
- I limited the % power to 90%, but later in the roast it started to miss the target, despite being at 90%, so next time I'll raise that limit.
- I'm pretty happy.
Looks great Gonzo....
Amazing what can be achieved with a bit of tweaking...
Looks very nice! Yay for not doing PID!
Having bought one of the Ozito variable temp heat guns (little knob on the side) I'm now tempted to mount a hobby servo on it as a super dodgy temp controller rather than taking it apart.
Yeah, taking it apart is a step down the darkside. If you have two systems for running the heat gun, you instantly place your system at risk. If you turn on the heat, you have to make sure you turn on the fan too. If you forget the fan, it'll overheat, and the overtemp cutouts are single-use in my experience.
I like the idea of driving the temp knob with a servo. However, if you go down that path, see if you can calibrate the knob rotation to the power output. Put a power meter on the mains to see what it draws relative to the angle you turn the knob. You may find that it is no-where near linear.
As far as the PID is concerned, I wrote a PID program, but very quickly determined that the lag time meant that it would be difficult to control. As I mentioned in another post, we're not trying to build a temperature control system which reacts to sudden changes in temperature, we're trying to roast beans, and we KNOW what the temperature profile is going to be. Therefore, we know the input power profile pretty repeatably. The only variables are the outside temp, the bean moisure and the quantity of beans.
Sorry. I'll stop preaching now.
I'm looking forward to the servo.
Actually, that's a very interesting idea re: power monitoring the mains. Somewhere I have small shunt amplifiers that are designed for power feedback measurement.
Do you know what the tempco of the heating element is? Could try using that as super dodgy feedback!
Tempco?? you've lost me...
Re power monitoring, just get one of those plug in power meters. I use mine for doing nerdy things like checking how much power my appliances consume so I can reduce my carbon footprint. They're cheap and measure real power, VA, power factor, average power over 24 hours (good for fridges), voltage, and so forth.
An annoying contraction of "Temperature Coefficient" I believe Gonzo....Tempco?? you've lost me...
Yep, I agree...yes it does change but would be a terrible way to control heat input
Not how I'd go about it.
Since may last PC roast (Pi-controlled) I have fiddled with a few things. And I've been anxiously waiting for the level in the roasted bean container to drop to my trigger point for the next roast. I've tried inventing excuses to do one early, but I was firm, in control, ... yeah right.
So one of the things I did was make a new thermocouple for my Yocto-Thermocoule. The thermocouple I had is a 100mm one, and I'd really like to poke it into the beans a bit more, so I need a longer one. Yocto supply two really tiny TCs (just the wires) with each board, but with no housing. "Well, I can make a housing", I said. "How hard can it be?"
So, fired with enthusiasm, I get some 3/16" copper tube, silver solder the end, round it off, poke in the TC wires and wrap them nicely. It all looks good. I check that it's working... yes seems to be. OK, it's time for the next roast....
The roast starts, and the PWM calls for MAX POWER. That's OK, I say, 'cos it's just starting. Five minutes into the roast, it's still at MAX POWER, and the bean temp is under the target by 5 deg. I start to think something's wrong. 10 mins into the roast I stick in a Tel-tru type thermometer, and it's reading 40 deg above the TC. That roast gets scrapped.
The leaning is: DONT MAKE A THERMOCOUPLE HOUSING OUT OF STANDARD THICK-WALLED COPPER TUBE. It conducts the heat away too much and the junction sees a temp much lower than the actual. It's a pity, really, 'cos it looked very profesh.
And now I don't have enough green beans to cover my new (thin-wall-stainless-steel-housed) thermocouple to do another roast, and I may run out of roasted beans this weekend. If only I'd done a roast earlier....
Perhaps the problem wasn't so much conduction, but just very poor heat transfer between the probe and the thermocouple itself? Perhaps try filling the end of the tube (where the thermocouple bead is) with a thermal paste and see what happens?
Ahh... good point. Yes, that could have made a difference. Although I can tell you that the outside end of the copper tube was getting mighty hot, so the heat was going somewhere.
Unfortunately it's a bit late as I've pulled the copper one apart to make the stainless one, and I've calibrated the new one against my dial thermometer, and they're pretty close.
The REALLY good thing is that Andy sent my beans yesterday when I ordered them, and they arrived today, so I can do a roast tomorrow. CS to the rescue!!
Ok, thanks to Andy I was able to do a roast today and won't run out of roasted beans!!
I trimmed all the settings since my first feed-forward-power run and I got a really good run today. See graph. The actual-bean-temp curve is barely distinguisable from the target line. It was all hands-off - the system did the adjustments.
For those geeks amongst us, here's the maths:
Remington "Big Loaf" breadmaker
Mass of beans 530g
Ryobi heat gun max power 2000W
Thermocouple in the bean mass
The system splits the power% required using the following equation:
P = K1*(TT-TB)/LA + K2*(TB-TA)
The first term is the power needed to raise the bean temperature (TB) to the look-ahead target temperature (TT) over the lookahead time (LA) in seconds. The term can be positive or negative, depending on the temperatures
The second term is the power needed to keep the system at the current temperature. It assumes an ambient temperature of (TA) of 25. The term is always positive.
K1 and K2 are constants
K1 is 250
K2 is 0.28
LA is 45 secs
to raise the temp from 175 to 179 deg in 45 secs, we need 250 x (179-175)/45 = 22 (22% of 2000W)
to maintain a temp of 175C, we need 0.28 x (175 - 25) = 42 (42% of 2000W)
The system looks at the required temp profile:
and it interpolates to find the target temp in 45 secs from now. Why 45 secs? Well I did some analysis of my results and found it fitted.
K1 is "trimmed" on the fly so that if it is consistently under the target, it increases/decreases to compensate. A consistent error could be caused by a lower ambient temp or more/less beans than usual.
So, if anyone else wants to do something similar, that's what I'm doing.
I don't have anything worthwhile to post, but I just wanted to say this was an entertaining read. I was thinking whilst modding my popper recently if anyone had created Pi/etc.. as it'd make a great little controller. Looks like you really have a neat little system going there Gonzob, nice work!
Just to let you know that the Roast-Pi is continuing to perform. The latest print-out is attached. 300g Tanzanian Machare Estate. I now use a 2-minute 50C "starting platform" at the beginning to make sure all is up to temp before starting the serious heating. Note the ~45sec delay between the heat starting and the bean temp beginning to rise. I've made a thicker and tighter-fitting chip-board cover for the breadmaker to keep chaff from going everywhere, and to keep better control of the temp. A side benefit is that the stirrer noise is reduced, and the cracks are easier to hear.
Looks like you've got the control pretty well nailed Gonzo...
What are the results in the cup like and have you tried changing profiles slightly, to see if you if you can detect cup outcomes? The idea being, that you could then control roasts to give you exactly what you're looking for in the end results.
Looking really good mate...
Looking real good Gonzo, glad its working for you.
My 300-700 gram roasts work very well with fairly accurate and repeatable results on my rig.
Lately I have been pushing bigger batches, 840 grams is the largest so far and find that at those sizes there is not enough heat output to keep up with the ramp up to first crack.
I'm going to try an additional heat gun on the next roast to see what happens.
Looking forward to hear your tasting report
Yes, fg, I have run larger batches (510g), but the power graph makes it readily apparent when the heat output is insufficient for the desired ramp. For example, see the graph above, where it hits 100%. I'm now limiting myself to 300g, and then planning to do what Mal says. 300g is a nice size for me - almost a week's consumption.
The plans I have are:
1. longer "plateau" in the middle
2. no plateau, but keeping the overall time (slower ramp)
3. as fast as possible to 200 then creep to 220
My tasting skills are not too developed, so I can't guarantee I'll be able to discern differences from the trials, but we'll see....
Certainly reckon you will taste the difference, now that you can control the roasts so accurately
Just use the same greens, run your three trial and we'll be interested to hear your findings! I went through this process myself over a number of months - very interesting process!
That's awesome, looks like your setup replicates the temps very accurately.
The Roast-Pi has just become more visible. See attached photo.
I now have a small display running off the composite video port on the Pi. It gives me Elapsed time, Currnt temp, Target temp, Power % (i.e.PWM). For those of you that think the display bears more than a passing resemblance to a rear-vision miror mounted reversing screen, you are right!
Note also the large hood to the left of the roaster. That sits on top of my bean cooler exhaust fan and drags the hot air and chaff from the top of the roaster. It sucks through a big kitchen sieve (under the hood) so the chaff is trapped. I remove it when the roast is over and I want to cool the beans.
Plenty of space on the screen to show ROR and a nice graph.
The reason for the screen was because I needed to know when FC and second crack were coming, and just as a check that the actual and target temps were not too dissimilar.
Amazing how this whole Internet thing works, isn't it? We're grateful for the inspiration and as we get the bits working we'll let you know how it goes. Our funding campaign has a few hours left to run at https://www.indiegogo.com/projects/t...res-de-ometepe and if you have a bit of spare change we'd appreciate it; even more so if you share our story with your friends. There's a photo of our roaster, made in Guatemala in the 00s on our Indiegogo site in the gallery.
While the Roast-Pi is doing its 77th roast, I thought I'd update the forum. I've added a few configuration options to the display - last week's roast looked like this:
It gives me the ability to change the peak temp and roast time, and the target profile simply scales itself accordingly.
Just a note to advise that the Roast-Pi has completed its 166th roast.
I've changed my usual profile to a "step", where the target is a slightly-inclined ramp to the final temp. It means that the heat gun goes flat out until it gets close to the ramp, and then the auto controls cut in and taper the rate of rise. Looks like this:
For the Sulawesi Blue I'm using, I adjust the final temp/time to just get to second crack. It gets a very repeatable result.
neat project! thanks for the post. I'm currently attempting to build something similar. I have no coding experience so I am attempting to read through your code and modify it to work for me. I'll update you if I get it working, and of course give credit where credit is due.
EDIT: Sorry for the double post. Not sure what happened and for some reason I can't delete the first post.
Last edited by cedar; 29th March 2018 at 06:02 AM.