Author Topic: Logging stove kPa  (Read 7889 times)

Offline Agrajag

  • Newbie
  • *
  • Solid or Perf: Solid
  • J or T : J
Logging stove kPa
« on: May 26, 2016, 05:17:47 AM »
So because I'm new to using the huky I've found I've been concentrating on too many things during a roast to keep pressing buttons in artisan to log power, however I realise it's very useful data to have. So I was thinking about ways to do it, something like a pressure transducer hooked up to an arduino would be ideal, however they are a bit $$$ and I don't really feel safe messing around with gas + electronics.

Would a webcam with image recognition work to read the gauge? Well turns out it does! Bit of a hack, but it was actually pretty easy using simplecv (image processing library). I sticky taped a coloured piece of paper to the gauge needle (high tech!) for easier recognition, calculated the angle and converted that to the kPa reading. Output of this is easily fed into artisan using an additional program device.


https://youtu.be/sPWICQQQpXo

Red outline is needle recognition, green is another bit of coloured paper I put there for an angle reference, this way the webcam doesn't need to be precisely positioned. I've got a few little issues to sort out but will post the source code + instructions once I've tidied it up.

Offline rawman

  • Full Member
  • ***
  • Solid or Perf: Starting with perforated but I have a solid as well
  • Serial Number: 842
  • J or T : T
Re: Logging stove kPa
« Reply #1 on: May 26, 2016, 11:01:58 AM »
Very nice. 

Offline edtbjon

  • Hero Member
  • *****
  • Solid or Perf: Solid (Perforated in the closet)
  • Serial Number: 498
  • J or T : J (Trying out a Cyclone)
  • Charge Weight : 300-400g
Re: Logging stove kPa
« Reply #2 on: May 26, 2016, 06:21:21 PM »
That is really brilliant! It goes to show that if a problem is to difficult to solve (in this case read: "expensive"), a different approach is what get things rolling. I havn't seen this approach anywhere in the coffee roasting forums. (Ok, I didn't look for it either, but I've seen the problem adressed elsewhere without any nice and simple solution.)
There are ways to log gas pressure, but I've only seen it on the $50K machines (Giesen comes to mind.).
Now, dare I roast even lighter?

Offline Agrajag

  • Newbie
  • *
  • Solid or Perf: Solid
  • J or T : J
Re: Logging stove kPa
« Reply #3 on: May 29, 2016, 04:24:55 AM »
Thanks :)

Just did a roast tonight with my setup, it was 100% accurate recording the kPa values, super happy with this! (yeah this roast got away from me a bit at the end, still early days for me with huky)



With my artisan controlled fan and kPa logging I don't need any artisan buttons at all :D I have set this up as an Extra Device but don't display a curve for it, instead I added it as a Quantifier with min/max of 0/4, so P25 = 1kPa, P37 = 1.5kPa, P63 = 2.5kPa etc.

Because I move my setup outside to roast and lighting conditions can change a lot, I added some calibration to my gauge detecting program which you do on startup, you can just do that while you're warming up your huky. I will hopefully tidy up the code and post it and some instructions tomorrow if anyone else wants to try.

Here's a pic of my setup, I made a little stand for the webcam. This is a seriously old/bad webcam, can only do 640x480. So if it works with a "worst case" setup it should work for anyone else.


Offline Agrajag

  • Newbie
  • *
  • Solid or Perf: Solid
  • J or T : J
Re: Logging stove kPa
« Reply #4 on: May 29, 2016, 04:50:30 PM »
Here's the source for the gauge reading program. I would be very interested to know if it works for other people's setups, I have programmed it in a way that it's configurable so hopefully it will.

https://github.com/phil-nelson/hukyroaster/

Requirements are python and simplecv and a webcam that can view your gauge. You will also want to make your gauge needle easily identifiable, I did this by coloring in a small piece of paper orange and using double sided tape to tape it to the gauge needle. The colour doesn't matter, you just want a contrasting colour to the surrounds. You will also want to make sure the webcam/gauge don't move during the roast.



When you run hukygauge.py, it will popup a window with your webcam display. Click and drag to draw a rectangle around your gauge, or the parts of the gauge that are used (I have a 0-10 gauge so don't even need to select the whole thing). It does this so that it knows the area to look for the needle, which is faster and more accurate than using the whole image.



It will then zoom in on that and ask you to click on the needle. It uses the area you clicked on as the identifiable colour (hue actually, I found hue was better than RGB under different lighting conditions) for the needle.



Now it calibrates the kPa values, so it will ask you to place the needle at 0, 1, 1.5, 2, 2.5, 3, 3.5 and 4 kPa. At each step click on the image to proceed to the next kPa value.



Then it will update the display and show the current kPa value in yellow in the middle and you're ready to go. It will update once a second. This program will just write to a file called "kpa.txt". To get this value into artisan, you need to get artisan to run an external program. You can just have a one-liner python script that does something like:

print ",,%s," % open('/path/to/kpa.txt', 'r').read().strip()

Replace that /path/to/kpa.txt to the whole path of wherever you saved hukygauge.py

This one-liner can be setup for artisan to run under Config -> Device, under "External Program". Then in the Extra Devices tab, add a Program_34 device. This is expecting the 3rd/4th argument in CSV output, which is why the above one-liner prints the kpa.txt as the 3rd value. Put "kPa" as "Label 1", have LCD 1 ticked and the others unticked. Now go Config -> Events -> Quantifiers tab. Tick the Power tab, select "0xT1: kPa" as Source, set min 0 and max 4. That's it! Artisan will run that one-liner program at each sample interval and log it as an event when it changes.

Offline Joey

  • Newbie
  • *
  • Seeking blueberry notes
  • Solid or Perf: Perforated
  • Serial Number: 1130
  • J or T : T
Re: Logging stove kPa
« Reply #5 on: September 06, 2016, 10:39:59 AM »
Thank you so much for this! Exactly what I was looking for! My Huky arrives this week and I'll definitely try to get this working on my setup. I'll report back with my results.

You mentioned that your fan is also controlled by artisan? How does that work?

Offline Agrajag

  • Newbie
  • *
  • Solid or Perf: Solid
  • J or T : J
Re: Logging stove kPa
« Reply #6 on: September 06, 2016, 02:45:56 PM »
G'day Joey, have a look here for info about the fan. Also here for how I managed to control the gas as well.

Offline AK

  • Newbie
  • *
  • Solid or Perf: Solid
  • Serial Number: 1073
  • J or T : T
  • Charge Weight : 350g
Re: Logging stove kPa
« Reply #7 on: September 15, 2016, 08:43:10 AM »

Then it will update the display and show the current kPa value in yellow in the middle and you're ready to go. It will update once a second. This program will just write to a file called "kpa.txt". To get this value into artisan, you need to get artisan to run an external program. You can just have a one-liner python script that does something like:

print ",,%s," % open('/path/to/kpa.txt', 'r').read().strip()

Replace that /path/to/kpa.txt to the whole path of wherever you saved hukygauge.py

This one-liner can be setup for artisan to run under Config -> Device, under "External Program". Then in the Extra Devices tab, add a Program_34 device. This is expecting the 3rd/4th argument in CSV output, which is why the above one-liner prints the kpa.txt as the 3rd value. Put "kPa" as "Label 1", have LCD 1 ticked and the others unticked. Now go Config -> Events -> Quantifiers tab. Tick the Power tab, select "0xT1: kPa" as Source, set min 0 and max 4. That's it! Artisan will run that one-liner program at each sample interval and log it as an event when it changes.


I'm sure that when I find out what I'm doing wrong, that I'll feel really stupid, but gonna ask anyway.


So I got mostly everything to work - simplecv reads my gauge, and writes out to kpa.txt with the right readings just fine.  But after configuring Artisan, I can't seem to figure out how it reads both the kPa AND the BT/ET readings at the same time.  When I configure the external program (Config->Device->Program) with the radio button checked, it reads the kPa, and displays the LED (but doesn't plot the event on the graph, which is another problem I need to figure out).  Unfortunately, with the Program radio button checked, Artisan no longer reads my ET/BT readings off the Phidget, because the Meter button is no longer selected. 


Also, not sure if this is a problem or not, but when I configure the Quantifiers (Config->Events->Quantifiers), my source is 1XT1:kPa (0xT1: MET). 


Thoughts? 


 

Resources

PRICING and FAQs

ARTISAN RESOURCES

PHIDGET INFORMATION

ROASTING GUIDES

ROASTING TERMINOLOGY

GREENS SOURCES

A FEW VIDEOS

Temperature Converter

Celsius:
Fahrenheit:
Kelvin:

Recent Topics

Rob Hoos article on Thermocouples by SusanJoM
August 31, 2017, 02:52:23 PM

CFM range for exhaust fan by edtbjon
August 30, 2017, 08:13:09 PM

Standard Stove - any ideas what to substitute it with at the European market? by hankua
August 30, 2017, 08:07:16 AM

Just Purchased, Hello from Claymont, DE! by hankua
August 30, 2017, 07:57:21 AM

Hello from Melbourne, Australia! by hankua
August 30, 2017, 07:55:07 AM

New to Roasting (opportunity to buy a Huky) by hankua
August 30, 2017, 07:52:18 AM

Hello from South Korea! by K.Brown
August 30, 2017, 05:40:09 AM

First Roast with Artisan, Feedback Appreciated by edtbjon
August 28, 2017, 04:17:34 AM

And another checklist to validate… by SusanJoM
August 25, 2017, 09:15:43 AM

Estimated Cost after Mods and Tools For Maintenance etc. etc. by edtbjon
August 25, 2017, 01:46:56 AM

Phidget 1048 Temperature() [Error 126] by MasterKraus
August 23, 2017, 06:41:08 PM

Any ordering at MLGP by jay
August 22, 2017, 06:44:05 AM

Powered by EzPortal