Coffee Roaster PID Mod

Discussion in 'The Projects Forum' started by james211, Jan 8, 2016.

  1. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    The coffee roaster (Quest M3 - 2015) I own is very easy to do a PID mod on which I want to do. For the most part, I know the basics of what I need, but I want some help verifying the parts if anyone can help. The PID is not cheap, so I want to make sure I get the right one.

    The software used is called Artisan (https://github.com/artisan-roaster-scope/artisan). The PID listed below is the only one that has specific support built into the software.
    • Fuji PXR/PXG 4 & PXR/PXG 5 PID
      • Modbus RTU option (needed to connect to Artisan)
      • Specific Artisan support implemented
    The fuji will do data logging for an MET (Maximum Environmental Temperature) probe and adjust the element accordingly to maintain a steady temperature. The other probe, a BT (Bean Temperature) probe will use an arduino with a TC4 shield for data logging. The software will receive the data logs from both devices and control the PID.

    So the list of hardware I know I need.
    • Fuji PXR4
    • SSR
    • RS485 to USB Converter
    • 110v to 5v Transformer
    1. FUJI PXR4
    I believe this specific PXR4 will work, but I need verification. Mostly because this thing is $250, and I don't want to screw it up.
    Socket
    Standard version, without socket
    INPUT SIGNAL
    R - Thermocouple (°F)
    CONTROL OUTPUT 1
    C - SSR or SSC drive output
    CONTROL OUTPUT 2
    Y - None
    POWER SUPPLY
    V - Standard (100-240VAC, 50/60Hz)
    ADDITIONAL FUNCTIONS
    M - RS485 communication (Modbus)
    ALARM OPTIONS
    4 - None

    2. SSR
    Omron G3NA-240B-DC5-24

    3. RS485 to USB Converter

    Robot Shop - Was hoping for a panel mount, but can't seem to find any.

    4. 110v to 5v Transformer

    Meanwell RS-15-5

    Beyond that, I have probes on the way from Omega. Here is a link to a gentleman who did this already. I reached out to him with a few questions but he hasn't been incredibly helpful.
    http://www.home-barista.com/home-roasting/another-quest-m3-pid-modification-t17668.html

    Thank you as always!

    I've also attached a schematic of the roaster.

     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    @james211

    PID Controller libraries exist for the Arduino. Also, you can get 230V relay shields for arduino as well.

    Why not do it all DIY if you can handle a micro. Much cheaper and you will know exactly how it works.
     
    wayneh likes this.
  3. wayneh

    Expert

    Sep 9, 2010
    12,126
    3,048
    Spending big bucks for fancy PID control seems like overkill for a device of that size. I believe measurement errors (due to large temperature gradients over the short distances and low thermal mass) will far outweigh the precision of the PID control.
     
  4. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Interestingly, that Fuji controller uses Fuzzy Logic, not PID to control the temperature (I think fuzzy is easier to understand and set up than PID for loop control).
     
  5. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    Totally understand your guys' points here. Essentially the way this software works is you run the roaster manually until you get a profile you like. Once you have a profile you like, you then go into auto mode and the software will control the PID making the process automatic for that specific bean.

    I just want to know if the parts I have mentioned all seem proper.

    I wish I had more knowledge of electro mechanical engineering but I don't. If I did, I'd certainly being playing a lot more. Truth be told with this particular setup, I just want something that works. This setup has been proven to work, hence my desire to build this setup. My issue is people didn't make their posts detailed enough to insure I buy the correct hardware.

    Thank you!
     
  6. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I don't understand what exactly fuzzy logic means in this context, but it seems pretty wonderful. This controller gets retrofitted into espresso machines quite a bit and it's so much better than other normal PID controllers in that context.

    With normal PID, it's very difficult, if not impossible to get an espresso machine to maintain a very stable idle temperature and also respond quickly to sudden, major temperature drops without overshooting. The Fuji somehow manages to be better in every way (except price!)

    It should probably be its own thread instead of a hijack, but I'd love to know what the fuzzy logic is all about!
     
  7. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    For a more on-topic response than my last one:

    You didn't specify, so I'll just double check. You did get Type K thermocouples, right? Looks like that's the only type the Fuji is set up for.
     
  8. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    So after a lot of research and getting in touch with the writers of the software for both the arduino and logging software, I learned that they have written PID functionality into the newest version. I now have the PID setup working and it works great!! I've never tuned a PID so I need to work that out. Anyone have any PID tricks for dummies?

    On a side note, I wired the SSR into the roaster with a switch so I can use it in either PID mode or in manual mode. When in manual mode the built in amp meter works, when in PID mode the amp meter is bypassed. I would however like to have an amp meter, but I'm not sure the best way to go about it. Do I wire in an analog meter? Is there a small digital meter? Or can I some how use the arduino with a shield or attachment and an LCD screen? Any thoughts?
     
  9. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Here's a good tutorial on Fuzzy Logic.
    I like Fuzzy Logic because it basically uses a series of If-Then-Else statements to perform a function, which are generally easier to understand than the PID equations, where the digital processor is trying to approximate the analog integral and differential functions.
     
  10. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I think any normal amp meter (analog or digital) would look silly watching the PID controlled amp load. It will jump from totally on (max current draw) to totally off quite regularly.

    If you want a sense of what heat setting you're at, or what the average current draw is over time, it would probably be more meaningful to see the duty cycle from the Arduino or the roasting software. If the average current itself matters to you as more than just an indicator of the heat setting, you could have the Arduino multiply the duty cycle by the max amp draw to approximate the average amp draw.
     
  11. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    Now that I think about it you're absolutely correct. I'll have to see if there is a way to see the duty cycle. There is an LED on the TC4 shield that indicates the PWM cycles. Its certainly not that important, but it would help with tuning the PID.
     
  12. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Thank you very much! I finally have some idea what's going on with fuzzy logic.

    Coincidentally, I'm just embarking on an R&D project that involves closed loop pressure/flow control in a very dynamic environment. I had assumed I'd use PID, but was already considering adding some If-Then-Else logic to speed response in extreme cases that are hard to tune for. I might take an alternate stab at it with fuzzy logic and see how it compares!
     
  13. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    I'm no good with computer coding, but I found it pretty straightforward to learn basic Arduino coding. I assume the Arduino has a duty cycle number already in there, which you could output in a variety of ways (serial out through USB to computer, little LCD, bargraph display, or even pseudo-analog out, like PWM through a low-pass filter, driving an analog meter.) If it turns out that the PID control is being managed entirely by the computer, with the Arduino simply passing the pulse outputs, you still might be able to get the Arduino to provide indications by adding some code to count the pulse timing and calculate duty cycle.
     
  14. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    Yes. This brings up an additional consideration, in that PID assumes the system behaves in a linear fashion. PID is basically controlling the linear dynamics of the system, as defined by its linear behavior, using complementary linear feedback. Thus it can be difficult (or impossible) to stabilize a non-linear system with PID alone.
    Fuzzy Logic doesn't depend upon it being a linear system and thus usually can be designed to more readily handle non-linear responses in the system.

    Here's another article on Building a Fuzzy Logic Controller that may be of interest in doing your design.
     
    Last edited: Jan 29, 2016
  15. james211

    Thread Starter Member

    May 29, 2012
    210
    2
    On a side note, I'm debating options for the hookup of this unit. Currently I have the SSR mounted on the backside of the roaster with a switch that switches between PID - OFF - MANUAL and a small LED that indicates when its in PID mode. I still need an enclosure for the arduino/TC4 shield as well. The unit uses a max of 15amps. What I'd like to do is have a control box that I can just plug into the back with one plug. That plug would need to carry the three wires for the switch at max 15 amps and the low voltage cable for the SSR. Is there any type of cable/connector that could do that safely and look good? Maybe a DIN connector?
     
  16. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Sorry - a few ideas came to mind, but when I looked them up, none were good for anywhere near 15 amps. There's got to be something out there, but nothing that I'm already familiar with.
     
  17. ebeowulf17

    Active Member

    Aug 12, 2014
    678
    79
    Thank you so, so much for the articles. I've successfully coded my first fuzzy logic control system! Just like the tutorial said, my very first pass at it worked better than the PID algorithms had been doing, despite a few bugs I later discovered. I think all the bugs are out, and it's working quite nicely now, although I still intend to refine things further to smooth out the response even more, if I can do so without sacrificing responsiveness too much. Although it was a fair bit of coding for a novice like myself, in reality was not that much work for how well the system works now. Wish I had known more about fuzzy logic sooner!
     
Loading...