Roast controller now at full power.

So I’ve played around with the PID settings.  I haven’t officially sat down and tried to do a “real” tuning since the processing app I’m using right now lets you play with different numbers and feed it back to the Arduino to tweak it.  As a result I came up with a few numbers that flattened out a lot more than it did previously.

First roast with crudely adjusted PID

Next I will need to take it more seriously I wipe out the configurations, dump some junk beans in, and fire up the roaster and calibrate until I can’t stand it anymore and then roast some coffee again.

In regards to the button controller I have figured out a layout that I will likely use but I’m trying to keep this accurate on the schematic system I’m working with to build a real PCB later.  For whatever reason the part in the system appears to not match every other part I’ve seen out there and what I’m currently working with.  I also need to go back to radioshack and buy a resistor I’m going to need because the big multi-pack I have doesn’t include that one resistor that I need to make the math work.

The last couple roasts with this new controller turned out decent enough.  After 3-4 days rest they had extremely good smells (but tasted only “pretty good”.)  Today’s two tests are MUCH closer to ideal roasting the way they worked out and the smells (and the smoke detector) agreed at the right times.  I’ve got two batches waiting that will get consumed over the next several days and we’ll see how it’s going as they rest.  I’ve got a single serve coffee brewer that’s working out better than some of the other ones so it will take me some time to work through all of the beans.

Ahh the smell of progress… roasting coffee!

So as I mentioned yesterday I roasted some coffee.  This time (except for manual control of the fan) the roaster did it all by itself.  I had given it a handicap of limiting power to the heater only to 85% of the capacity but it appears to have worked ok.  The Arduino roaster controller worked well enough considering the state it is in.  Power control from the Arduino worked for manual potentiometer signaling the fan speed and a data array of settings for the heat controlled the roast automatically trying to maintain the temperature.

I’m going to increase the power again to 90%.  The room temperature was around 45-50 degrees since I roasted it out in my garage so I think it did pretty well getting to temperature.  I’ve also bumped the fan up slightly to a higher maximum.

I will need to get a button controller going soon so that I can force the system from automatic into manual mode so I can quickly shut down heat if necessary without having the laptop connected while letting the fan continue to run.  I’ve got a CAD type design of a PCB going that has a button controller but I haven’t ACTUALLY prototyped it out on some RadioShack boards.  I do have some etch-able boards here to try a toner transfer to build out some controls.  I still need some carbide drill bits though for drilling the through hole parts and the jumper connectors.  If I had SMD header pins I think I actually have all the parts I’d need to build a 6 or 7 button analog pin matrix.  I may need a couple more resistors though to pull that off.  I’m pretty sure I could get at least 4 buttons though.

The power control system had started to get out of control with the heat sinks so I had to beef it up some.  Before anyone says it I know the large heat sink is on upside down.  I didn’t want to drill the board before I was sure it was going to work so those bottom pins are sticking out the top.  I’ll probably run it like this for a little while until I make a permanent board though.

So for those of you keeping track… I went from this:

First working prototype in Radioshack Project Case

To this:

This is MUCH better for the following reason…heat sinks got out of control and all the wires were getting obnoxious:

Next Steps?

  1. Increase allowed power to heater
  2. Make button control pad.
  3. Tune PID.
  4. Improve CSV log system.
  5. Add automation to the Fan control.  Use mild PID triggered adjustments to the fan.  Coarse heat changes by heater.  Minor heat changes (a few degrees) by Fan.
  6. Add current sensor to judge wattage to the heater.
  7. Get profiles loading from SD memory using button pad to select them.
  8. Begin creating circuit to connect my original PIC32 project to the arduino over serial / rx/tx or other communication method.
  9. Complete 7 inch touch screen (I have a screen designed but it’s not entirely stable yet… the backlight flickers occasionally and the image stutters here and there but it’s there…)  I’ll upload a bitmap from the layout tool soon.
  10. Migrate most functions to PIC32 eventually.
  11. Build a final PCB.
  12. Get a case made for it.
  13. Roast lots of coffee.
  14. Brew it.
  15. Drink it.

First test run of the Arduino FreshRoast SR500 Controller

This afternoon when I was home for lunch I ran the Arduino control touching a light bulb plugged into the heater output.  It tracked the heat pretty closely until it got up around 300 degrees.  It overshot by about 10-20 degrees initially and then once it caught up it was pretty close the rest of the way pulsing the power as necessary.  After it neared 300 degrees it couldn’t keep up and started lagging.  At that point I left the fan running at full speed for the duration of a normal roast.

This evening I went out and plugged in the heater.  The heater is a totally different monster!  It tracks but it OBVIOUSLY needs the PID calibrated until it works better.  At low fan when the heater dies down it has a massive swing in temperature going under and then back over again.  It appears to only do ok at the lower temperatures and then is all over the place at the higher temperatures.  What is noteworthy is that it DOES track the same “slop” drift around the target temperature all the way up.  The drop/gain on the % power is simply too drastic and needs to be adjusted to flatten out more.

For giggles I’m throwing out for view a test graph as it ran (no beans) for a few minutes once with low fan and another with higher fan.  I have the heat maxed at 80% power in the program so that I don’t burn anything up accidentally until I’m sure it can run like it should.

First Arduino Roast Controller test with heater connected

In the lower graph it shows a low fan vs a higher fan setting.  The middle one is a heat amount that actually gets reduced to 80% in the code during testing.  The green in the top graph is the target while the red is the actual temperature reading. Both tests were run with the roasting chamber left empty.  I’ll try adjusting the PID settings a little bit to smooth it out to have smaller sweeps and then start loading some old green coffee in to test it with a “load” and see  how much that stops the swing.

Now that the heat is able to be completely shut off this helps the temperature drop a lot faster.  It’s my guess this would be better for the roaster overall to completely drop the temperature of the coils before turning it off while it cools the beans.  I’ve set the system so that the cooling requires the probe to reach a low temperature before turning off so the coffee beans should be quite cooled before it shuts down by itself.

Arduino roaster controller with zero crossing dimmer

With all the time I’ve put into the Pic32 roaster I’ve always had this nagging worry that any of my sensors may have had damage during testing. When you try to get something working and keep getting gibberish you need to find a way to rule that out. As a result I decided to purchase an Arduino a few months back to confirm everything works. Turns out (so far) that everything IS actually working and I didn’t damage any sensors.  In the months I’ve been working with the Arduino I’ve actually learned a few reasons why some of the sensors didnt work on the PIC32 the way I had programmed them because learning to program an Arduino is sooooooooooooooooo much easier and better documented for “average people” to figure out compared to reading the hundreds of pages of technical manual for the PIC32 that isn’t ACTUALLY even finished being written yet.  There is a ton of code out there to test every single sensor I’ve purchased so far on Arduino. In addition I decided it would be a great way to start the dimmer using zero crossing detection in a system that runs outside the PIC32 before I convert it.

My intention is to get basic functions working on Arduino, then get the PIC to talk to the Arduino to send it commands to switch power by itself while the PIC reads all the sensors and logs data and then decides what to do as it comes from the Arduino.  Finally it will eventually be migrated entirely to PIC32 when I learn more about the interrupts on PIC32. At the moment I’ve put together a board that takes in 120VAC and uses Q4015L5 Triacs and MOC3052 drivers to control power to two receptacles. It reads the zero cross on my power using a H11AA1 and gets an interrupt used to trigger power switching. During my initial testing I confirmed the zero cross detection circuit worked and switching the triacs manually on or off worked without  regard to the zero cross state. It unfortunately didn’t seem to actually switch automatically for some reason when I wanted it to dim.  After a few days of testing I realized the Arduino Mega and the Uno had the interrupt timer pins in different places.

Since this is the first mains power circuit I’ve worked on I started running it with a variac out in the garage (and then fed that out into the driveway at the end of an extension cord…) and gradually turned the power up from 0 to 120VAC testing each section as I built it to ensure nothing arced or got hot or burnt up.  During late November I hooked it to the Arduino and got it to begin adjusting fan and heater under PC control as well as using two separate knobs.  Later in December and January I got it to begin logging to SD memory and following a programmed profile.  After that I added a bunch of additional environmental sensors and mounted it in a RadioShack project case.

 

First working prototype in Radioshack Project Case

I’m now at a stage where I’m looking to consolidate the various sensor cards either down onto a circuit board or attached to a set of pins directly.  I’ve grown tired of accidentally unplugging random wires carrying it back and forth from the garage to my office area and out to the kitchen stove / vent at various stages.  My hope is to shrink it down to a much less complicated arrangement being mostly on a single circuit board and interfaced by a few short cables to the Arduino.  It’s a bit complicated currently and getting worse.

Jumble of Arduino stuff

For the Arduino I’m using the MEGA 2560.  It is attached to the power control box pictured above via the DB25 cable.  At this time the box only controls power but I’ve mapped out pins on the DB25 to use for future boards to allow sensor breakout boards from a variety of DIY electronics companies to plug into them.   I’ll break this out to various header pins that match various breakout boards so they can be directly attached.  I’ll probably also design positions for eventually soldering chips directly to a board later once I order them when I’m further along and jumper the headers into those sections.  This will let me test a circuit on the board while still ensuring it actually works with the breakout board first.  The board will be designed to replace the items in the RadioShack box using SMD parts in some cases where cheaper and more convenient to shrink the board down smaller.  I hope to have it all shrunk down and consolidated to a single board with a DB25 connector to get to an Arduino I’ll be mounting inside an Arduino Crib case.

FYI I’ve taken a tiny break…

So as some of you may have guessed with the gaps between postings I have way too many hobbies.  One of them includes aquariums.  I only do freshwater stuff but I do more than “a goldfish in a bowl”.  Really I mainly focus on plants, shrimp, and a few not really extreme fish that are deemed compatible with the shrimp.  The plants need lots of light to make them grow which is why most people can’t keep aquarium plants alive.  The shrimp pick at the base of the plants pulling away the dead parts and look cool.

Several months ago I had some setbacks with some shrimp and some illnesses that came in with them.  I’ve decided to start over and build a setup that is designed to keep all of the conditions very solid that was hard to do in the “nano tank” that I had been using.  This resulted in ordering a new tank that came with a matching size stand that was unfinished.  I had to sand, finish, and assemble a stand and I’ve been throwing together a bunch of automated controllers that monitoring a variety of probes and adjust things…. not much different than controlling conditions in a coffee roaster.  Eventually I’ll be building my own control system for it and I’ll be selling off the existing control system that I’m installing just to get it running.

There is obviously value in “get it done now” vs building it yourself.  There is always a cost to results ratio that needs met to justify buying something or doing it yourself.  I think a lot of the coffee roasting world in the DIY arena operates in this world.  For people who cannot do it themselves and insist on programmability etc there are 800-900 dollar roaster systems.  For everyone else there is 150-500 dollar roasting setups.  Finally for those that want to make a 900 dollar roasting system on their own there’s Arduino and other micro controllers and the $9.99 Poppery roaster to the $200 random brand entry level roaster.

Anyway, I’m at a stage with the roaster that I need to hook up relays to cycle the heating systems on and off.  I’m probably going to order a second SR500 base from a site I found on the internet to take apart completely and splice these relays into it for the microcontroller to cycle.  I’m pondering the 3 stages of heat from the selector switch and actually cycling the power to the heater element.  I need to check some voltage readings from inside the roaster once I take it apart and decide if I want my controller sending signals in place of the switch to vary the desired heat status or just control the heater.  It might be easier to try controlling the fan speed first from my controller and then come back to the heater later.

For the moment I need to finish the fish tank stuff.  This weekend I’m trying to finish the under tank plumbing and then get the tank up on the stand.  The tank is an 18x18x18 25 gallon glass tank (no plastic, only a silicone seal between the glass).  I’m using a Neptune System Apex Controller underneath and am running all the sensors into the plumbing underneath.  The light on top is a 70 watt Metal Halide and the I’ve got CO2 gas bubbled into the plumbing based on the pH.  The entire thing gets logged and can be graphed onto a device web page.  I’m using an Eheim Ecco canister filter and running the output through a UV sterilizer, inline heater, and the CO2 reactor.  Later (once I get the right fittings) I’m mounting a IceProbe chiller inline through some plumbing as well.  I need to modify it with different fans to push air from inside the enclosure through the heat sink and then vent it out of the tank rather than blowing air down onto the heat sink.  The fan is pretty noisy so I’ll be replacing it with fans used to make super silent computer vent fans and running a series of small ones along the sides blowing inward and one large one up top to suck outward that will pass through the base enclosure wall.

I’m kind of discouraged in the coffee world right now.  Mainly I’ve been waiting for a good Ethiopian coffee to come in but this year has not been a good year for coffee.  I’m trying to figure out what else I want to try as my “base” coffee for the ongoing roasting experiments.  I really need to have a base to compare one roast to the next as I adjust the programming on the controller rather than having different beans roast after roast.  I just havent found anything I want to drink week after week while I work out the kinks.

FreshRoast SR500 Wattage

Earlier in the blog I posted photos showing the circuit boards inside the roaster that were labeled 1000W.  The roaster was reported as being 1500W and it’s a pretty major deal to be 1000W vs 1500W.  After looking back at the blog and some of the things I’ve worked with and struggled it made me wonder more about the wattages used by the SR500.  Additionally it seems there are a lot of people that come to this blog looking for information about how many watts the SR500 is.

In the interest of providing accurate information I went out and got a device for measuring wattage drawn by a device.  Upon plugging it in I discovered that the SR500 draws .8 Watts in “idle” mode.  For comparison a coffee pot I had here with only an Off/Timer/On toggle button and a button to let you change the clock and a tiny little LCD you can’t even REALLY see except when trying to look at it to program the start brew time was drawing 1.2-1.5 watts.  When I turned on  the coffee pot it went to around 1460-1470 watts.

Back to the coffee roaster the manufacturer reported it as 1500watts.  Looking at the circuit board it seemed to show 1000W on one of the labels.  Turns out it is indeed 1500 watts when running full force as described.  I have no idea why the circuit board reports 1000 watts.  I started thinking maybe there is something with the electronics and mainly the fan that would suck up a significant amount of wattage while it was turned on.  Knowing the model of processor inside the circuit and the other parts there was not a lot of electric being consumed.  This was proven when looking at the cool cycle.  First let’s start with the typical roast numbers.

Starting we have .8 Watts  in a sort of standby mode waiting for the controls to turn the roast on. [Edit 4/14/11 – The meter in a sort of standby of its own with nothing plugged into it runs about .5 watts.  This means the roaster in standby probably consumes something more like .3 watts.]  Once I turned on power it lurched upward and for many of the settings hovered +/-  one to five watts one way or the other from the following numbers:

Fan / Heat / Wattage Reported

Low / Low / 1420
Med / Low / 1475
High / Low / 1500
Low / Med / 1420
Med / Med / 1475
High / Med / 1508
Low / High / 1420
Med / High / 1475
High / High / 1505 to 1520

The wattages slowly ticked up and down without seeming to be connected too heavily to anything in particular that was going on.  This was measured WITHOUT the roasting chamber in place allowing the roaster to simply run full force.  When I have more time I’ll run a regular roast through and see if there is any significant peak points where the numbers differ much fluctuating during the roast and if there is a pattern to any of it.  This leads to cooling.

Cooling for all intents and purposes is the roaster running with all electronics EXCEPT for the heater.  This is particularly interesting because the amounts that the wattage changes is not necessarily reflected on each of the tiers for the fan/heater combo.

High Fan / Cool / 182 watts
Med Fan / Cool / 148 watts
Low Fan / Cool / 107 watts

As you can see the wattage of the roaster is pretty reasonable to be called 1500 watts.  You cannot say that the HEATER is 1500 watts….  but it IS a 1500+ watt device like most other items advertised that way.  Why the internal parts are labeled 1000w I cannot imagine.  My guess is there may have been an earlier design that reused the same circuit board to control things and it just needed a stronger heater element.

The roaster appears to not vary the heat outside of the full power to the heater element and then it turns off when the LOW/MED/HI threshold is met.  I expect to see the wattage go from 1400-1500ish down to the 140-180 range every time the heater cycles the way this looks.

For those looking for an update on SD memory I am pleased to say that I found the problems with the SD memory wiring that were actually conflicting with more pins than I knew.  I also found a couple other places that were conflicting randomly that I had odd symptoms that I had not traced yet.  How did I do this?  I blew up the datasheet pin diagram from 8.5 x 11 to 3 feet by around 2 feet something after color coding a few of the pin types and then systematically crossing out a few pins that I have no control over which ones are used because they either HAVE TO be used due to existing circuit boards on the development kit or else there are so many other pins being used in a “set” that I cannot use that function.  Examples would be if you needed to use UART1 TX/RX.  These are on pins RF2 and RF8.  ALSO living on these pins are SDI and SDO #3.  Obviously if you use UART 1 those pins are tied up and now you cannot use SPI (SDI/SDO) set number 3.

Once I cross those functions off the list it makes it soooo much easier to find all the other functions that I need to place or can place in other locations.  I’m gradually transferring these items into a schematic building power supplies and VGA interfaces etc onto them.  I’m beginning to get closer and closer to having created a full schematic for the entire project up to this point.  I can convert that schematic into a circuit board layout and after a few more rounds of tests and seeing if I can figure out a few more sensors I’ll probably be ready to test out a preliminary test board that will become a “condensed” development platform.  This will let me test 1) building circuit boards, 2) knowing that I’m close to getting a functional system, and 3) having a lot less junk on my desk.

I’ve now managed to get time and date stamp and temperature readings sending to a CSV file that loads easily into Excel that I can apply a chart to.  Next up — Roasting something to get real temperature numbers.