Giter VIP home page Giter VIP logo

raspberrylatte's Introduction

RaspberryLatte

A full stack suite to add smarts to a single boiler espresso machine using a Raspberry Pi Pico as the brains. The project was started with the following goals in mind:

  • Feature Rich: Going beyond the standard PID temperature control, RaspberryLatte should provide advanced features that make pulling the perfect shot easier. These include
    • PID temperature control with feedforward components
    • Automatic flow control
    • Output scale
    • Preinfusion and autobrew routines
    • Coffee profiles
    • Scheduled heating [Planned]
    • Realtime state viewer (mobile UI) [Planned]
    • Machine statistic tracking [Planned]
    • Shot diagnosis and logging [Planned]
  • Low Cost: The cost should be minimized. The base hardware should be less than $100.
  • Discreet Appearance: External parts, which would typically be 3D printed, should be minimized. Furthermore, the design should not require any external displays. In other words, the finished product should be discreet and not look like a DIY IoT device.

Features

Advanced Temperature Control

Uses a PID controller with a feed-forward component to regulate the boiler's temperature. The resulting temperature is within 1% the setpoint throughout the shot.

Autobrew Routines with Flow Control

Automatically runs user configured brew routines. These will regulate the pump's power so that a desired flow rate is maintained over the course of the shot.

User Adjustable Settings

The temperatures, flow rate, preinfusion routine, dose, yield, and other settings can all be customized without reflashing the code. The pump switch and mode dial are used to navigate a folder structure while the three LEDs display the current values of the parameters as they are adjusted. This allowed for full customization without any additional hardware (e.g. screens, buttons, etc.).

Project Architecture

This project can be thought of in several layers.

Hardware Level

The lowest level is the hardware such as sensors and switches required to create a smart espresso machine. Additionally, a custom carrier board is needed to interface with these components. This PCB contains any circuitry required to support the sensors and switches. Mounted to this carrier board is the Raspberry Pi Pico W.

Front View Back View
Front view of main board Back view of main board

Firmware Level

The next level consists of the firmware running on the Pico. This code, written in c, contains all the sensor drivers and machine logic. The firmware is partitioned onto a single core of the dual core Pico.

Network Level (Planned)

The network level runs on the second core on the Pico. It collects information from the firmware running on core 0 and shares that over BLE with the Mobile UI level (see below). It also passes settings received from a BLE client to the firmware so that the machines performance can be tailored to achieve the desired brew characteristics.

Mobile UI Level (Planned)

While ssh is fun, a mobile application would be significantly more convenient. This level would allow users to create and share their brew profiles for different coffees, visualize a shot's flow rate, pressure, temperature, etc. in real time, and troubleshoot their shots. This application would interface with the Network level using BLE, simplifying the connection process.

To-Do

  • Add carrier board design to repository
  • Add UI based on onboard switches and LEDs
  • Add flow control to autobrew routines
  • Add wiring diagram
  • Add BOM for hardware
  • Implement network leve
  • Implement mobile UI level
  • Design logo
  • Write project documentation

Documentation

Project Documentation (Under Construction)

To help with your build, project documentation is being written in another repository. Clone and build the sphinx docs to view.

RTD Documentation screenshot

Code Documentation

The documentation is generated from the code's comments using doxygen. Below is a sample page showing the autobrew library. Clone and build the html to view the rest.

Doxygen screenshot

Inspiration

This project has taken inspiration from others who have taken the time to write up their own builds. The two primary sources have been the Es(pi)resso project, and the Espresso for Geeks blog. Big thank you to both those makers for sharing the great work they did!

Contribute

If you are interested in helping with this project, I would love to talk! You can reach me through Twitter.

raspberrylatte's People

Contributors

hallboyone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

mistajkillah

raspberrylatte's Issues

Inconsistent API

Some modules have hidden struct implementations (e.g. pid) while others do not (e.g. machine_settings). This should be consistent.

Add thermal runaway safeguards

There is currently nothing checking that the boiler is responding as expected to the heater inputs. This can lead to thermal runaways should the sensor come detached or fail. Functionality should be added to monitor the state of the boiler and enter an error state should a thermal runaway be sensed.
This could be modeled after the thermal runaway logic in the Marlin 3D printer firmware. The basic rules are

  1. The temp must be changing at some minimum rate when the machine is settling to a temperature (i.e. responding to control inputs)
  2. The temp must not deviate too far from the setpoint after settling (i.e. sensor fails as in #16)

Add pressure profiling to autobrew routines

Currently, the auto brew routine can only regulate the flow rate. It is possible that the user may want to regulate the pressure instead. This should be added as an option for the auto brew routine.

Enhancement - Steam boost

A steam boost feature should be added. When in steam mode, activating it would cause the pump to slowly run, adding more water to the boiler. The water's cooling effect will be offset by the feedforward PID term. This should increase the steam power and duration.

Ground plane around AC traces

There is not enough clearance around the traces caring AC loads on the PCB. The ground plan should be carved out in this area.

Make integral windup bound dependent on output limits.

Currently, the integral windup bound is set to a fixed value. However, this can lead to overshoot e.g. during flow control when 100% power is needed to reach the target flow rate. This leads to e(t)*Kp + e_sum(t)*Ki = e(t)*Kp + 100 > 100 (where the last inequality holds only when the flow is below the target).

Instead of the fixed bounds, e_sum_lb <= e_sum(t) <= e_sum_ub, the windup bound on the integral term should dependent on the proportional input: e_sum_lb - e(t)Kp <= e_sum(t) <= e_sum_ub - e(t)*Kp. This is equivalent to the fixed bounds when at the set point, but it keeps prevents the error sum from growing when the error is large (i.e. the proportion term is dominate).

ENHANCEMENT-update-settings-in-terminal

Using the local dial and pump switch, though functional, is very clunky. With the newly expanded setting structure (120 folders!) it takes a long time to navigate and get set the way you want it. It would be much easier to do this with a console interface prior to the implementation of a remote application.

Missing I2C pull up resisters

Problem Summary

There is a note in section 4.3.1.3 of the RP2040 data sheet discussing the use of the RP2040's I2C hardware. It reads

Note: There should also be external pull-ups on the board as the internal pad pull-ups may not be strong enough to pull up external circuits.

However, the current schematic relies on the internal pull-ups. This could be the cause of the intermittent problems communicating with the NAU7802.

Proposed Solution

Add 4.7KOhm pull up resisters to the SDA and SCL lines on the RaspberryLatte main board.

No external pull-up/pull-down resisters on board

Problem Summary

There are no external pull resisters on any of the main board's output signals (include the I2C bus as stated in #3). This can lead to dangerous situations where a crashed program and floating output can cause one of the AC components (heater, pump, solenoid) to get stuck in the on position.

Proposed Solution

Add 4.7KΩ pull up resisters to all the output signal lines on the RaspberryLatte main board.

Occasional spikes in temperature

There are occasional spikes (positive or negative) in the temperature. I have only noticed them for a single time step, but they should be addressed.

Replace return-to-root with up-a-level in local_ui

Currently, once you are don't changing a setting using the local_ui, you have to return to root before changing another setting. This is very annoying and would be better replaced with just going up a single level to the parent folder.

Add constant temp offset

The temperature at the sensor and the temperature at the show screen may have a slight offset. This offset should be added to the firmware as either a constant value (configured based on the machine being used) or a user configurable value. Then, the temperature set point would just be offset by this amount internally.

CRITICAL - Occasional erratic behavior in boiler

I have observed occasional erratic behavior in the boiler. I'm not sure if it's software (sensor driver, PID implementation, etc) or hardware (sensor failure). Best guess is an overflow error somewhere in the PID controller, but I need to do more tests.

5V flow rate not supported by control board without modifications

The control board was designed for 3.3V flow sensors. Turns out, they are almost exclusively 5V. To get around this with the current design, a jumper has to be soldered on and a voltage divider used to drop the 5V signal down to 3V. This should be updated in the next version of the board so no jumpers are needed. This is also related to issue #8 discussing cleaning the power to the flow sensor.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.