Page 1 of 6 123 ... LastLast
Results 1 to 10 of 58

Thread: Kudos to Bryan!

  1. #1
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046

    Kudos to Bryan!

    After spending way too many hours working on my own Arduino based PID controller, I have a much deeper appreciation for everything the HeaterMeter does.

    I'm actually using the HM board right now for my prototype since it's already got a microcontroller and TC amp on it and with a raspberry pi attached to it, I can remotely flash the controller running on my bench in the basement, while I sit on my couch on the main floor!

    Here's the HM v4.2 board controlling a solid state relay in an espresso machine I just finished refurbishing for a project. My original plan was to use another HM v4.2 board with only the minimal components connected to allow reading of the TC, and controlling the SSR, but the HM board has the I2C ports in use and the PCB is just a tad too large, so I'm going to end up using an Arduino Nano + Adafruit AD8495 board.



    Code for the controller is here https://github.com/shmick/PID-Controller

  2. #2
    TVWBB Diamond Member
    Join Date
    Apr 2013
    Location
    midwest
    Posts
    3,608
    The espresso machine made me curious.... why do you need the HM for this purpose, doesnt the temp control on the unit work?
    I created the Roto Damper, RD3, HMv4.2 sliding back case, "air-burner" and the "ping-pong" valve in my quest for delicious "set and forget" BBQ.

  3. #3
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    Espresso is a finicky process, with the ideal brewing temp at 95C. High end machines come with a PID controlled boiler to keep the water temps stable. This machine, and many like it, use a cheap bimetallic thermostat that control the power to the boiler, which can fluctuate the water temps in the +/- 7C range. Replacing the cheap thermostat with an external thermometer and modulating the power to the boiler with a solid state relay, controlled by a PID loop, really makes a big difference.

    You can buy these cheap PID controllers, but then you end up with an ugly looking box attached to the side of the machine.

    I want to keep everything inside the machine and I also liked the idea of working on an arduino project that directly benefits me, so this is the route I took. The entire machine has been a project in itself as it's a machine from the late 90s and was not maintained well at all. I cleaned, repaired, replaced worn seals, painted, etc the whole thing and now it's running like a dream!

    Here's a pic of the thermocouple threaded into the boiler, where the old thermostat would normally be. It's a K type thermocouple with m4 threads. Apparently a common 3D printer part!



    Here's a graph of the PID data from this morning. Need to tweak the PID values a little. Actually, I'm only running in PI mode right now. The dip in temps about mid graph is when I pulled a shot of espresso. The hot water in the boiler was being replaced with room temp water from the reservoir.

    Last edited by Steve_M; 06-16-2018 at 09:23 AM.

  4. #4
    TVWBB Diamond Member
    Join Date
    Apr 2013
    Location
    midwest
    Posts
    3,608
    Thanks for the explanation, I asked because I have been using one of these espresso machines for about 20 years now...

    It's been a very reliable unit, though I have bought a broken unit for parts and have repaired mine once (not bad for 20 years service!). Having repaired my unit I am pretty intimate with the design, very similar to what you are working with (I guess most are).

    One of the things that has frustrated me over the years is how the unit goes to ready state and clicks off the heat, then when I am brewing it doesn't maintain temperature as consistently as I would like. Maybe the rig you are working on would improve performance of my machine.

    Please post updates if possible, I may experiment with something like this myself. Thanks for the inspiration!

    PS if you are looking for low profile HM the 4.2 is not the way to go. Get the 4.3 main board only kit, it's cheap and very small.... 4" X 1.85" without the display board or rPi. With a rPi Zero-w it is 4" X 2.65"
    Last edited by RalphTrimble; 06-16-2018 at 09:28 AM.
    I created the Roto Damper, RD3, HMv4.2 sliding back case, "air-burner" and the "ping-pong" valve in my quest for delicious "set and forget" BBQ.

  5. #5
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    A PID controller on the boiler would help for sure, otherwise you have to "temp surf" which means watching for the ready state and timing the shot exactly.

    This is what I'll be using. It's an arduino nano, adafruit ad8495 thermocouple amp ( same on that the HM uses ) and a logic level shifter to hookup a raspi to the serial pins. The logic level shifter may or may not remain. I also need to add a header to power the 5v regulator and a header for the OLED display

    Still figuring out component placement. All of the A-W rows are connected underneath, like a breadboard would be, but with solderable pads.

    Last edited by Steve_M; 06-19-2018 at 12:05 PM. Reason: reduced image size

  6. #6
    TVWBB Diamond Member
    Join Date
    Apr 2013
    Location
    midwest
    Posts
    3,608
    Isnt that rig bigger than the HMv4.3 base board?
    I created the Roto Damper, RD3, HMv4.2 sliding back case, "air-burner" and the "ping-pong" valve in my quest for delicious "set and forget" BBQ.

  7. #7
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    It's a little taller, but narrower compared to the v4.3 board.

    The HM board also had the I2C pins in use and the adafruit TC amp has a precision reference voltage, whereas the HM reference is ground.

    Last edited by Steve_M; 06-19-2018 at 12:05 PM. Reason: reduced image size

  8. #8
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    Here's the PID chart from the espresso I made this morning.

    The PID output is now based on 0-100% rather than a fraction of the total PWM window. The PWM window was set to 0.5 seconds and I was seeing some odd behaviour where the SSR cycle time didn't seem to change over a wide range of PID output. This is when I learned more about how these SSRs work. They can only change state during zero crossing of the AC sine wave. With 60Hz AC, there are 120 zero crosses per second, or 8.333 milliseconds between each zero cross. The PWM routine was previously trying to send pulses of less than 8.333 milliseconds, which wasn't working properly.

    The PWM window is now set to 4167 milliseconds (a multiple of 8.333 ) and with a PID output of of 0-100%, each output percent should be 41.67 milliseconds, which is 5 zero crossings.

    PID values are P = 6, I = 0.02, D = 0

    In an effort to speed up the initial heating process, I bypass the PID routine, keeping the boiler fully powered until it reaches 90% of target temp and then the PID controller kicks in.

    Last edited by Steve_M; 06-17-2018 at 09:15 AM.

  9. #9
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    Got v1 of the board wired up today. The Arduino, 5v regular and TC amp board are connected via pin headers, so not fully soldered in.

    Still need to attach connectors to drive the OLED display ( 4 pins ) as well as a pair of pins to trigger a higher setpoint for steam mode plus come up with a way to properly mount it all inside of the case.

    After some tweaking, it seems like the ideal PWM window is about 3.5 seconds

    Last edited by Steve_M; 06-19-2018 at 12:05 PM. Reason: reduced image size

  10. #10
    TVWBB Guru Steve_M's Avatar
    Join Date
    Jul 2013
    Location
    Toronto
    Posts
    2,046
    The OLED display came today. It's pretty tiny, but with a 128x32 pixel density, it's very readable, even at a distance.


Page 1 of 6 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •