☕ Coffee extraction: a $100B optimisation problem disguised as a 30-second routine.
@JacklouisP14K followers
56,158 views
20 Comments
Comments from the original post on X (Twitter)

@JacklouisP
What Is Coffee? To understand why this has anything to do with robotics, we need to start with the basics. The raw material: Coffee beans are seeds from cherry-like fruits, packed with: - Caffeine: Natural pesticide (1-2% by weight) that gives us our energy boost - Chlorogenic acids: Antioxidants that create brightness and acidity - Sugars: Locked in complex carbohydrates (30-35% of bean mass) - Oils: Carry flavour compounds and create mouthfeel - Proteins & fibre: The structural matrix holding everything together
8 likes

@JacklouisP
Why roasting matters: Raw coffee beans are essentially inedible wood. Roasting is controlled pyrolysis: - Heat breaks down cell walls → releases trapped compounds - Maillard reactions → create 800+ new flavor molecules - Caramelisation → converts starches to sugars - CO2 formation → creates the porous structure that allows extraction The result: A brittle, porous matrix containing the concentrated essence of the original fruit - ready for grinding & extraction.
7 likes

@JacklouisP
The Chemistry Challenge: Selective Dissolution Coffee extraction is fundamentally a selective dissolution problem, where only the desirable compounds are dissolved while the undesirable ones are left behind. The extraction physics: - Good compounds (acids, sugars, oils) dissolve first with heat and pressure - Bad compounds (tannins, bitter alkaloids) require longer contact time The challenge: Stop extraction before the bitter stuff kicks in to get the perfect flavour.
7 likes

@JacklouisP
The Extraction Sweet Spot The magic zone: 18-22% of the coffee bean's mass dissolved into water. Under-extraction ( 22%): Everything good PLUS harsh compounds Tastes: Bitter, dry, astringent The tell: Makes your mouth dry up (like overbrewed tea) The sweet spot: Maximum good compounds before bad compounds dominate.
9 likes

@JacklouisP
The Engineering: How Espresso Machines Control Variables An espresso machine is a precision fluid control system managing 6 variables simultaneously: - Water temperature: 90-96°C (extraction rate) - Brew pressure: 9 bars (flow dynamics) - Dose: Coffee mass (typically 18g) - Grind size: Particle surface area (THE key variable) - Distribution & tamping: Bed uniformity and resistance - Yield: Target liquid output (determines ratio)
7 likes

@JacklouisP
How The Machine Works Temperature control: The machine heats water using either a boiler, heat exchanger, or a thermoblock system. PID controllers maintain temperature within ±1°C using real-time sensors. Pressure generation: Internal pumps (rotary or vibratory) pressurise water to exactly 9 bars. Safety valves prevent over-pressurisation while flow restrictors maintain consistent pressure. The group head: This is where precision matters most. A three-way solenoid valve controls water flow, while a dispersion screen with 100+ tiny holes distributes pressure evenly across the coffee bed. The portafilter: Acts as both a filter and a reaction chamber. The basket has precisely sized holes (0.3-0.5mm) that create the right flow resistance. Heavy metal construction maintains temperature stability. The Extraction Process Pre-infusion: Low pressure (2-4 bars) wets the coffee bed evenly Full extraction: 9-bar pressure forces water through coffee particles Flow monitoring: Sensors track volume and timing Automatic shutoff: When target yield is reached Real-time feedback through pressure gauges, flow meters, and timers lets you monitor every variable. Every shot is a controlled chemistry experiment in 25-30 seconds.
7 likes

@JacklouisP
The Automation Paradox You could automate every single variable. Push a button, get espresso. But here's the problem: Fully automated machines consistently produce mediocre coffee. Why? Because perfect extraction requires constant adaptation. Beans change daily as they age. Humidity affects grind consistency. Equipment drifts over time. Customer preferences vary. Machines follow predetermined protocols. They can't taste the difference between sour under-extraction and balanced sweetness. The breakthrough insight: The best coffee comes from strategic human-machine collaboration.
6 likes

@JacklouisP
Controlling the Chaos: The Master Barista Approach Elite baristas use a constraint-based optimisation strategy that turns 6 variables into a manageable system: Step 1: Let machines handle precision - Modern espresso machines excel at temperature and pressure consistency. Set them once, trust them completely. Step 2: Standardise the controllables - Fix your dose (18g becomes your constant) - Perfect your tamping technique (consistent pressure, level surface) - Nail distribution (even coffee bed every time) Step 3: Choose your target ratio - Pick your desired coffee-to-liquid yield. Common target: 1:2 ratio (18g - coffee → 36g liquid) Step 4: Optimise through grind size - Now you have ONE variable to adjust: grind fineness - Start medium, pull shot, stop at target yield (36g) - Taste: Sour = grind finer | Bitter = grind coarser - Repeat until balanced - Lock in the grind setting Step 5: Use time as your consistency check - Perfect shots take 25-30 seconds. - If tomorrow's shot runs 35 seconds with the same settings, something changed (bean ageing, grinder drift, humidity). - Time becomes your early warning system.
7 likes

@JacklouisP
Why Humans Still Win The gap: Machines are precise but not adaptive. Current espresso machines only have basic sensors for temperature and pressure - they're essentially blind to extraction quality. The magic happens in what humans sense that machines can't (yet). Multi-sensory feedback is required: - Visual: Flow color, crema formation, stream consistency - Sound: Extraction rhythm, grinder motor load changes - Smell: Aroma shifts indicating extraction phases - Taste: Complex flavor compound detection and memory
6 likes

@JacklouisP
Rule-breaking intelligence: A skilled barista knows when to break the standard rules. Want a ristretto? They'll decrease the ratio to 1:1.5 without causing under-extraction by adjusting grind size and timing simultaneously. Want a lighter roast to shine? They'll drop the temperature by 2°C and extend the extraction time. Machines follow protocols. Humans adapt in real-time based on sensory feedback and experience. That's why the best coffee still comes from expert human-machine collaboration, not full automation.
9 likes

@JacklouisP
The Broader Lesson Perfect espresso demonstrates that complex optimisation problems are sometimes best solved through strategic human-machine collaboration, not full automation. When machines do have the right sensors, they dont have the right data. The winning formula becomes: Machine precision + human adaptability + constraint-based design. In robotics: Don't automate everything. Design systems where humans and machines each handle what they do best. Next time you drink great coffee, remember: You're experiencing a masterclass in human-machine collaboration.
6 likes

@KemonomichiNL
As someone’s family who is in the coffee business Most coffee making is just LARP & marketing Ppl cannot tell the difference in most blind tests
3 likes

@JacklouisP
I think once you start having good coffee it’s very hard to go back. But if you’ve never had it you can live in blissful ignorance
2 likes

@j_santry
Every time I try to use this thing at SFO, it's sold out of every coffee... must be good!
2 likes

@JacklouisP
Or just looks cool

@Chuck_Petras
@BrianRoemmele

@swelfy
I feel 1000+ molecules is understating it a little.

@iautinyman
a THOUSAND molecules?

@SamHamErasmus
I’ll keep the $7 latte from the nonbinary Skidmore art grad thanks

@therealjackruby
Yes, what IS coffee?