Kudos to Bryan!


 

Bryan Mayland

TVWBB Hall of Fame
Keep plugging away at it, I'd love it if you would be able to figure out some new amazing noise-fixing circuitry or method or identify a new problem. Originally, the HeaterMeter circuit used 1M between TC- and GND but I found it to pick up a TON of noise and make a mess. I've tried on several occasions to raise the value back to where it probably should be at 1M, but it always ends in a noisy mess. I've also tried going down to 1k resistors on the TC+/- and upping the capacitors a decade to compensate but didn't see much difference. The Adafruit resistors are even one more decade lower with the same capacitors which should make their filtering even less effective!

It could be the ferrite they have on the input power that is making a difference. There's no specs listed for it in the schematic so I'm not sure how to quantify its effects. I've tried creating a 3.3V "analog" rail as well with a separate linear regulator, inductors, ferrite beads, ferrite chokes, more capacitors, most seemed to make the noise worse. You could be on to something with the reference voltage though. If the reference voltage is more noise-immune than just the ground plane, it could act as a stabilizing force because any ground noise is just added to the output voltage in the HeaterMeter setup.
 

Steve_M

TVWBB Guru
I plan to keep at it, though I'm going to spend some time figuring out Eagle or something to generate a PCB.

On my DIY PCB, I've replicated the same 5v and 3.3v power config at the HM using extra components I already had on hand. I did this as I read the 3.3v supply on the wemos D1 mini wasn't too beefy, but in measuring the consumption of the TC amp, OLED and external ADC, the combined draw was under 10mA. Either way, nothing wrong with having a stable, dedicated 3.3v feed!

I was really baffled last night when I discovered the instability when switching from the USB battery pack to a USB wall adapter to power the Wemos, which in turn powers the rest of the components on the breadboard. I've got another OKI-78SR-5 that I'll pop onto the breadboard and will see what happens with that. I also ordered a couple of AD8495 boards from aliexpress. They have a narrower/longer footprint than the more square adafruit board. I'm sure they'll arrive sometime in February!

Again, Kudos to you. Getting all these lego pieces to fit together nicely is no small feat!
 

Steve_M

TVWBB Guru
Using graph mode on my mooshimeter, here's what I'm seeing on the output of the TC amp.

Wemos D1 connected with a USB battery pack:


12v wall adapter to OKI-78SR-5 with 5v out into the 5v pin of the Wemos D1 mini. Similar results when plugged directly into the Wemos.


I still need to A/B the output from the Adafruit TC vs the HM TC
 
Last edited:

Steve_M

TVWBB Guru
I've also been looking at the software side of things. I added this little function to see how fast things were running. Yes, I do realize that the process of timing the loop will inherently increase the time to complete a loop :D


Code:
void trackloop() {
  if ( now - prevLoopMillis >= 1000) {
    currLoops = numLoops;
    numLoops = 0;
    prevLoopMillis = now;
  }
  numLoops++;
}


At first I was getting the result of ~85 loops/second ( 85Hz ). Pretty brutal considering the ESP8266 has an 80MHz processor.

Reducing the thermocouple read + NIST calc routine to once every 5ms changed the loops per second by around 19,000, thats almost 225% gain in efficiency. I also had some delay(1) calls that seemed to be needed to keep the watchdog timer from getting upset but a single yield() placed in the middle of loop looks to be doing the trick and that increased loops/sec by about 500.

I'm sure there are some more efficiencies to be made, but I'm pretty happy with the results so far.
 

Steve_M

TVWBB Guru
My thoughts while killing time on my train ride to work.

I think the main issue is the low voltage output from the AD8495 and even though the DC noise is minimal, since the output is already so low, it just gets amplified. My hypothesis is that the 1.25v reference voltage on the Adafruit board masks the noise better as a couple of mV of noise won’t be seen when you’re already starting out with 1250 mV before the TC amp adds to it.

Next hypothesis. If I use something like the ADR510 1.0 shunt regulator to add -1.0v as a reference voltage to the AD8495 my output will always be between -1.0v and 0v (0v being 200C) which allows me to use the 4x gain multiplier on the ADS1115 which operates in the range of -/+ 1.024v
 
Last edited:

Bryan Mayland

TVWBB Hall of Fame
I'm not sure noise works like that, it should be an AC signal on whatever DC bias is there, be it 0V, 1.25V or -1.0V. What I think it is providing is filtering that attenuates the noise. I'm not sure though, all this analog stuff is like magic to me, and I mean the kind of magic that never works right!

You could also try a capacitance multiplier to power the AD8495/ADC. They're used to smooth out higher voltage power supplies (usually mains frequency) but I don't see why they can't be employed for lower voltages stuff too. The concept is the same as the low pass filter we have on the HeaterMeter probe lines, except they can't supply any power because the 100k resistor will only pass so much current (33uA at 3.3V). To boost that, a simple NPN transistor is used to amplify the current, effectively "multiplying" the size of the capacitor by the hFE of the transistor (~100x for a 2N2222). Here you can see a quick demo I threw together in the Java Circuit Simulator showing 5V input with a 1V 1kHz noise signal on it and the corresponding smoothed output with even the most modest 1k/1uF low pass filter. The 1k resistor on the output is just to simulate a load, but you'd put another capacitor on the output just like there would be if this were a voltage regulator.


I'd say try it with a 10k resistor, a 100uF capacitor and 0.1uF in parallel (low ESR is key), and a 2N2222 or any NPN you have on hand and see what you get?
 

Steve_M

TVWBB Guru
I had a feeling I was somewhat wrong in my assumptions. I'm not an EE and I certainly don't pretend to play one on TV!

I'll see if I can give the capacitance multiplier a try. Thanks for the info.
 

Steve_M

TVWBB Guru
This project has remained in its status quo for some time now, mostly because I'm making delicious coffee and if it aint broke, don't fix it!

Last weekend I scored another Gaggia Classic (same make / model as the one I have) for dirt cheap and am going through the process of making it PID controlled as well.

Last night I wired up a solid state relay and a new K type thermocouple to the boiler and connected it to my the pre-existing wemos + ads1115 controller setup I've been using all this time thinking this should be a simple swap, but no! I started seeing the input temps bounce around on the new machine, where things were nice and stable on the old machine. So what gives?

After a bit of tinkering around, I tried connecting the aluminum boiler (which has the thermocouple screwed into it) to the same DC ground as the rest of the circuit and voila, the noise went away. Making sure this wasn't a fluke, I removed and added the ground back a few times and every single time I grounded the boiler the noise went away and temps stabilized.

I wonder what's different between these 2 thermocouples. They're both generic k type thermocouples with an m4 screw head that are commonly used with 3D printers.
 
Last edited:

Steve_M

TVWBB Guru
Maybe one TC is isolated and the other isn't?

Yeah, that looks to be the case. I continuity tested the first one ( QIDI Technology Thermocouple ) and neither of the wires appear to be connected to the brass m4 threaded connector.

This is the new one, and while the look the same, they clearly aren't. This grounded style is obviously affected by the SSR pulsing the current through the heating element of the boiler.

Neither of the listings shows them as being isolated or grounded.
 
Last edited:

Gary V

TVWBB Fan
Steve,
Been watching this thread for awhile and like seeing digital controls implemented in a simple device for making expresso. I am sure that some of the manufactures out there are watching your progress and like what they see. I have a couple of tid-bits that might help. Your control circuits common and the stainless/cast aluminum components of the brewer must be bonded. This will reduce and or eliminate noise issue. You found out that using the battery your unit was stable and then when you change to switching power source it would get noisy. I would try bonding the DC common of power source to the metal plate in the brewer. This will bond all the commons to the same rail. If any of the switches and thermos switches in the brewer are currently bonded to the plate on one side of the switch terminal, this would cause an issue and then I would not bond power source common to metal plate. Another thing I will bring up is that most ssr`s will switch comfortably between 20hz and 60hz. Anything higher than 60hz is a no go and will cause oscillation and or just poor control. Thermal controller such as a Omega control always offer 2 types of interface on the back. One for relays and one for ssr`s. When using ssr`s the control loop must work slower to work within the spec of the ssr. Also if your bonding everything together, make sure the thermocouple is not grounded.
 

Steve_M

TVWBB Guru
PID controlled espresso machines aren't new, it's just adds more cost to the cut throat consumer market. All of the commercial machines are PID controlled already. There's also off the shelf kits available, like these ones from Auber. I went the full DIY route because it gave me a practical project to work on and I enjoy learning new things.

The SSRs I'm using are AC load specific, and only switch at the zero crossing of the AC sine wave. At 60hz you get 120 half cycles per second, meaning you can safely cycle things up to 120Hz.
 

MartinB

TVWBB Pro
PID controlled espresso machines aren't new, it's just adds more cost to the cut throat consumer market. All of the commercial machines are PID controlled already. There's also off the shelf kits available, like these ones from Auber. I went the full DIY route because it gave me a practical project to work on and I enjoy learning new things.

The SSRs I'm using are AC load specific, and only switch at the zero crossing of the AC sine wave. At 60hz you get 120 half cycles per second, meaning you can safely cycle things up to 120Hz.

Yep no shortages with pids in the espresso world. Pid, infusion, etc.

Not to mention it really doesn't even matter on most consumer machines . they don't have a large enough boiler or enough Mass on the boiler or group head to give you temperature stability that's needed. you can try to improve these defects with a PID but it's still going to leave you wanting a much better pro-sumer machine. So it's pretty much pointless except on a few machines that are high quality.
 

Steve_M

TVWBB Guru
The brass grouphead on the Gaggia Classic is a good hefty chunk of brass. It takes about 8 or 9 minutes for temps to stabilize after turning it on. I use the web interface on the PID controller to verify if the unit is ready. If I see PID output hovering around 5% then I know that it's simply maintaining the setpoint. I've also added code to turn the boiler off after 3 hours as well as the ability to tell it do switch back on or off as needed. This lets me start things up remotely and by the time I arrive home, I can grind some beans and pull a shot without having to wait!
 

Steve_M

TVWBB Guru
Still no "proper" PCB, but I'm one step closer to getting the controller mounted inside of the machine. Found these Hi-Link AC to DC PCB mount transformers and they're working out well.

I've ditched the OLED display for now since I was never really looking at it. It's easy enough to add back into the mix by adding 4 pins to the board.

I really need to figure out how to make a proper PCB for this now that I've got the final design sorted out.

 
Last edited:

Steve_M

TVWBB Guru
Used EasyEDA for this. It's a work in progress, but pretty happy with the results so far!

 
Last edited:

Bryan Mayland

TVWBB Hall of Fame
Nice! Never head of EasyEDA before, that's a neat browser-based PCB design system. When you joined this forum 5 years ago did you think you'd be designing circuit boards? :-D
 

Steve_M

TVWBB Guru
Nope, I sure didn't. The HeaterMeter really opened my eyes to microcontrollers and circuit designs. I've always been a pretty technical person, using linux since '95 and always being in a systems / ops role dealing with servers and data centres and jumped on the RasPi bandwagon pretty much on day 1.

The HeaterMeter allowed me to break things down to bite sized pieces that made more sense to me. Seeing how all the stages worked 12v > 5v > 3v > microcontroller and then how the input and outputs to/from the microcontroller worked was what I needed. Kinda like breaking it down into lego blocks that you can stick together.

Coming back to the title of this thread, kudos to you for making a cool product that allowed me to learn something new!
 

Steve_M

TVWBB Guru
After way too long, I finally got around to getting the PCB re-designed and fabricated since my protoboard setup didn't really lend itself to being moved around too much. Now everything is inside the case of the espresso machine and gets powered on when the machine is switched on.

The result:



The code and PCB files are here
 

MartinB

TVWBB Pro
Getting it inside the gaggia case is awesome.

I understand its a hobby. Fun. Challenge, to overcome the limitation of the tiny boiler.

I dont know if it was made clear back at start of thread in way others could understand...at least i didnt see it in the first few posts....

.the water temp problem is due to cold water being pumped into boiler at same time you take hot water out to brew. .....rapidly dropping the temp. Large boilers are inherently more temp stable....and desireable due to this. The gaggias boiler is tiny tiny. As are all inexpensive espresso machines.

Taking 35 ml out of a 2L boiler on commercial machine, and replacing it with 35ml cool water.....barely changes the temp. , And doesnt affect it at the grouphead at all. The effect on the gaggias tiny 100ml boiler is 20x, requiring high heating to be applied during the shot, necessitating good control.

Making good espresso isnt cheap or simple.

One possible fix for the problems inherent with small machines....is 2 small boilers in series. Refill the boiler feeding the shot....from another preheated reservoir.( Boiler)..and temp fluctuations are reduced to level of commercial machine. Vibrating pumps cant pump very hot water, so cant heat an unpressured reservoir much..
 
Last edited:

Top