HeaterMeter Controller, with Wifi, and Electric Smoker (MES40) Mod in Detail

  • Some of the links on this forum allow SMF, at no cost to you, to earn a small commission when you click through and make a purchase. Let me know if you have any questions about this.
SMF is reader-supported. When you buy through links on our site, we may earn an affiliate commission.
Yeah, I realize now that there are several parts of the HM board that you don't even need to populate for an MES, but who knows when it will be used for another type of smoker that will require them.

After about an hour I increased the temp up to 240. Overshot again but not as much. I agree with some meat in there it might not be such a big deal.

I don't think I could even come close to your masterful OP... I'll just tag on here if you don't mind.

Good to see the overshoot is not going wild after a new set temp.

I have no problem with you adding all that info here it at all :)
 
@Telemachus

Do you have plans to wire in an On/Off switch or do you plan to just plugin/unplug for the on/off functionality?

I was just curious because I can visualize some approaches but making them LOOK elegant may be a bit more involved an is a bit of a sticking point in my head at the moment :)
 
I am designing a new case that will fit atop the MES and mount on just like the stock one. It is going to cover up both the power port and the rj45 port on the left hand side and the cable will exit the bottom. The right side ports will be open for the probes.

In theory it would be pretty simple to wire an on/off switch into the new case... it would just interrupt the 5V power supply.

That having been said, when the smoker is not in use it gets unplugged and covered up... so not much use to me really.

If i do leave it plugged in, I already have 3 Raspis running 24/7... one for the doorbell, one for the 3d printer, one for my son's jukebox... one more wouldn't hurt much. Solar power is plenty cheap!
 
I am designing a new case that will fit atop the MES and mount on just like the stock one. It is going to cover up both the power port and the rj45 port on the left hand side and the cable will exit the bottom. The right side ports will be open for the probes.

In theory it would be pretty simple to wire an on/off switch into the new case... it would just interrupt the 5V power supply.

That having been said, when the smoker is not in use it gets unplugged and covered up... so not much use to me really.

If i do leave it plugged in, I already have 3 Raspis running 24/7... one for the doorbell, one for the 3d printer, one for my son's jukebox... one more wouldn't hurt much. Solar power is plenty cheap!

Makes sense.
If I had it to do all over again I wouldn't have added my so-called variable speed controller for the convection fan I installed into my MES. That would have greatly reduced the needs on the size of the box.
I also would have tried reuse as much space as I could with the built in MES compartments and so. I would have drastically cut down the need for my controller box which is basically a hunk of metal hahaha.

It works very well as it is so I'm not gonna mess with it unless something really craps out. Oh how hind sight is 20-20 :D
 
Naw... your box rox! Own it, and love it!

I would imagine you could use the blower control on the HM to control your variable speed convection fan. It would be pretty simply to use another pin to control your relay, and would only take a few changes in the source code...
 
Naw... your box rox! Own it, and love it!

I would imagine you could use the blower control on the HM to control your variable speed convection fan. It would be pretty simply to use another pin to control your relay, and would only take a few changes in the source code...
Maybe when something breaks down. As of now I'm gonna rock it until it fails :D
 
Could you share some details with me about how you went about tuning your PID? My overshoots are crazy high!

(BUT doesn't that chicken look great?)
 

Attachments

  • 20180125_223310.jpg
    20180125_223310.jpg
    117.9 KB · Views: 60
  • 20180125_223621.jpg
    20180125_223621.jpg
    80 KB · Views: 64
Could you share some details with me about how you went about tuning your PID? My overshoots are crazy high!

(BUT doesn't that chicken look great?)

Warning: Long post of with lots of boring info lol :D

Well I started from scratch knowing nothing about PID tunning.

I tried to use the types of tunings I could find when it came to the HM and the blower fan BUT it was not apples to apples since the blower fan stokes a heat source and the electric smoker heats up an element. The response time is drastically different.

Then I tried to incorporate some info I found from PID tuning with HVAC systems and again not apples to apples.

The next iteration was to try and and go with really high numbers (in regards to PID) to try and get things in tune since I figured the numbers would course correct more quickly but things were too erratic at various set points, so another approach was needed.

I then tried to use the tunings from the Auber PID from the first MES rewire job that I gave to my mother as a gift. I gleaned more info but again not apples to apples because the algorithms were not the same between the Auber and the HM, so back to the drawing board.

At this point I just went and read up on a bunch of PID tuning in general rather than specific systems (blower + charcoal, hvac, SV, etc.). Armed with my trial and error knowledge, I came to realize that I would have to just start with plain jane PID tuning tactics and start at a base low numbers for tuning and work up to find the right combo.
I started with a base low number for P and then gathered my info on it's behavior.
Then on to tuning I and gathering the behavior info.
Finally moving to tuning D and gathering the behavior info.

I went through a number of iterations of this to see what was working along the way an the result of a set of values for the entire PID tuning.

After doing it enough times and gathering the info I found the magic set of values that worked for the HM and it's PID algorithm.

In the end I found that the documentation for the standard HM PID tuning was of no real use because it was all centered around a blower fan and the responsiveness being way faster than an electrical element based system.

I found that it was educational but not very helpful to try and utilize tuning info and values from other systems like HVAC, SV, or the Auber units because their systems had way different performance response times AND each one likely had a different PID algorithm. This meant I was never apples to apples and was always apples to elephants :)

I found that the only thing that worked for me was to do basic principles of PID tuning practice in conjunction with the knowledge I gained from the HM documentation on how the HM PID control behaved in general and the fact that I had a slow responding system compared to most systems out there that are documented or have tuning info available.

With all of that info I was able to try and try again with the most generic of PID tuning practices while understanding my system more with each attempt until I dialed it in :)


Steps that Should Lead to Better Performance

I THINK you have mentioned that you have a different algorithm for your HM so my tuning values may not be spot on.

Try to reduce the P value to 3 and see how things respond. Remember that all of the I and D behaviors are going to be calculated off of the P value so only change it and see how things behave. Reducing P in general should reduce overshoot but you also don't want it to fail to hit the set temp.

[EDIT: Removed erroneous portion of the statement.]
From there I would leave the "I" tuning alone.
I would bump D up to like 120 - 140 to see if it can get a minor decrease in overshoot. The idea would be that it would maybe slow the initial ramp up to set temp a little so that it can't overshoot so badly.

Again start with only P and see how things respond.
After a number of P reduction trials, go with the best performing P and then increase D and perform trials there to see if you can help the overshoot.

I think you will get there it just takes some effort. Let me know if any of this info makes sense/helps and ask away if you have any questions. Best of luck! :)

OH, and the chicken does look amazing! Chicken was my go-to with all of this trial and error dialing because it is the cheapest. Man did I get a ton of chicken smoking in and a great appreciation for smoked chicken hahaha! You are on your way to consistently amazing smoked food my friend :D
 
Last edited:
Yeah I need to work it out. My temp shot over 300' last night. I'm not sure when the therm protection switch is supposed to kick in but I just opened the door first.

I was thinking of following Bryans method here:

https://tvwbb.com/showthread.php?69444-Quick-PID-Tuning-Example&highlight=Tuning

Why do you say I can't go below 1?

Well I guess you can lol.

Maybe I was confusing it with the Auber value range. I believe the Auber cannot do fractional numbers, only whole Integers. My bad :)
 
Would numbers off my Auber help you any? I've got a couple sets of numbers from Auto tuning it at different temp settings. I'm trying to figure this PID deal out so I figure if I auto tune at different temp setting and different ambient temps maybe I will get an idea of what does what.
 
I guess they can't hurt... the heater meter is made to turn a variable speed fan up and down, so it really is different than many other PID.

Tall, what does the output on your HM look like when you are smoking? I thought the percentage output would just go back and forth between 0 and 100, but it moves all over the place.
 
Tall, what does the output on your HM look like when you are smoking? I thought the percentage output would just go back and forth between 0 and 100, but it moves all over the place.

I think I have the answer for you.

My output is up and down between 0 and 100% but usually doesn't hit 100% unless I am ramping up to the set point from 0F or after a door open, see some of my recorded smokes here:

According to documentation and what is seen in the behavior/graphs above. I believe the setting "on above" is the answer to your mystery. According to the HM documentation:
  • on above - Do not run the blower at or below this PID output. The blower output is linearly increased from this value to 100%, where the blower output will be MAX. Setting to 50% means that the fan won't turn on until the PID output is above 50%. To replicate the old "only on at MAX" setting, set "on above" to 99%. (LinkMeter v13)
For our electric smoker setup the "on above" setting should be 0.
So if I am reading everything properly, when the PID output is above 0% then the Pulse ON signal is sent. Also having the Min and Max set to 100% makes it so you get 100% signal output, so only 12V sent rather than a lower voltage.

This all means that if you have a PID output of > 0 then you should be getting a 12V (3V in your case) control signal sent out to the switch (SSR/relay) so it will cut ON the power to the heating element.
Hence the output in the HM graphs never really hitting 100% output to come on.
I do think that the graph fails to display the 0% output well but I'm sure it is there and I would just need to zoom in.

When watching in real time I see the graphed output go to 0 in the output valleys but it doesn't stay there very long because the system loses heat so quickly that the heat has to be switched back on quickly and then it takes a bit of time to build the heat back up.
I'm sure the combo of quick heat loss and slow heat build up over hours of smoking makes the 0% output valleys invisible unless you zoom in.

How does this all sound? :)


full
 
I certainly see 0 in the P tuning phase. But when I add in I and D it never seems to quite get there. Could it be that anything less than 50% turns on the fan at 100% and anything over 50 turns it off?

Using Zeigler-Nichols method tonight I have gotten to where I am happy enough with my results. I never shoot much over 5 degrees now and the oscillation is pretty minimal.
 

Attachments

  • Screenshot_20180127-214445.jpg
    Screenshot_20180127-214445.jpg
    175.9 KB · Views: 57
  • 20180127_214914.png
    20180127_214914.png
    605.8 KB · Views: 53
I certainly see 0 in the P tuning phase. But when I add in I and D it never seems to quite get there. Could it be that anything less than 50% turns on the fan at 100% and anything over 50 turns it off?

Using Zeigler-Nichols method tonight I have gotten to where I am happy enough with my results. I never shoot much over 5 degrees now and the oscillation is pretty minimal.

Wow sounds like you got dialed in!

Anything is possible, so your less than and greater than 50% notion might be happening but I'm not completely sure it is. I say this because you can see in detail the overall PID output go from 0-100% and you can enable the PID display to show each value's percentage in real time. I've seen plenty of times where these values and the overall output is 0% or the values having a negative total % value. I'm thinking that the graph is just not displaying the 0% well all the time... I could be wrong here as well :)

In addition to seeing the output % in the bar just under the flames, you can hit the "P" key and it will display the individual PID % values in real time as they are calculating. See the PID detailed display in the upper left hand corner of the following image. The values all add up to be greater than 100% so output is 100%
With that little display open you can see detailed behavior of your individual PID output %.

In the following image you can see that the P and the D values add up to like -93% which is way below 0 total so the PID output is 0%.

In short, I see the PID output both as a total and as individual values go to 0% (or a negative total with the detailed PID values shown). At the same time of 0 output I see the temp slow down or drop.
Seeing all of this leads me to believe that there is a graphing issue rather than a functional issue when it comes to 0%.

Again I could be wrong. Feel free to turn on the detailed PID display and watch it at 0% and see what your temperature does, then note if for some reason the 0% output valleys fail to show up or even dissapear on the graph (I believe I've even seen the 0 output graph valleys disappear).

Let me know your thoughts and any observations you make with the PID detailed display on :)
 
Not really, its nothing proprietary.

Here's some details:
The Esp8266 I use is a micro controller with built in Wifi. It runs at 3.3 volts. The board has a linear regulator.
The Microchip part is the 12 bit spi A/D, it is not the controller. There also 2 quad op amps for buffering, along with some resistors and capacitors.

The Esp8266 is fully supported by the Arduino guys. You can even use the Arduino IDE.
I am using the BLYNK platform for IOT. I use a local Raspberry Pi Blynk server for lowest latency, and unlimited app resources (free energy).

I see your post says the transformer is only 250ma. I'm not sure my Gen1 has. Esp uses more than that iirc but I think only in surges, maybe a big cap would help. Maybe I am under powered. I didn't see any power issue on my scope.

As for the relay:
Basically the PID interrupt occurs ever 200msec, and it evaluates every 60 seconds. At the eval point it decides the power level for the next 60 seconds. If its too small, it saves the small bit and adds it to next eval. This way the relay doesn't get pulsed on too short of a time, and still preserves the smaller results.
To Wit:
////RELAY OUTPUT CODE: We are here at pid timer rate
////This code executes at pid timer speed, NOT AT PID COMPUTE SPEED!
//turn the output pin on/off based on pid output
//Limit minimum on/off time, per PID cycle
void outputToRelay(double output, int bNewPidCalc)
{
unsigned long RelayMillis;
static int iMakeUpMillis=0, iOweMillis=0;

if(output<0) output=0;
if(output>PWM_STEPS) output=PWM_STEPS;

RelayMillis=(unsigned long) (output+.5)*(PID_CYCLE_TIME/PWM_STEPS);
//RelayMillis=1000;
//RelayMillis=29000;
//RelayMillis=4500;

if(bNewPidCalc) {
iMakeUpMillis=iOweMillis;
//Serial.print("iOweMillis: ");Serial.print(iOweMillis);Serial.print(" iMakeUp: ");Serial.print(iMakeUpMillis);Serial.println();
}

RelayMillis+=iMakeUpMillis;

//A short turn skips this cycle and adds to next cycle
if(RelayMillis < RELAY_MIN_TIME && RelayMillis) {
iOweMillis=RelayMillis;
RelayMillis=0;
}
//A short turn off subtracts from next cycle
else if(RelayMillis > PID_CYCLE_TIME-RELAY_MIN_TIME && RelayMillis < PID_CYCLE_TIME) {
iOweMillis=RelayMillis-PID_CYCLE_TIME;
RelayMillis=PID_CYCLE_TIME;
}
else {
iOweMillis=0;
}

unsigned long now = millis();
if(now - windowStartTime>=WindowSize) { //time to shift the Relay Window
windowStartTime += WindowSize;
}
if(RelayMillis >= now - windowStartTime) HeatControl(1);
else HeatControl(0);
}

As for the sensor:
In my gen 1, the internal sensor is supplied with 5 volts from the MB regulator. With a suitable terminator, I can read that, but the output will be referenced to the 5 volt supply. Not the best situation for a ratio metric A/D. Better is to use an external probe. I use Thermoworks, it comes with a nice little grate clip too.

Mine is hand wired. If you want to make a board up, I can help you out.

So just the Esp8266 as the brains? I'm just reading up on Arduino controllers. Sounds like one (Uno?) might be necessary to program the Esp8266, but from your post and pic the Esp8266 is all you need with some logic, power, and protection around it.
 
SmokingMeatForums.com is reader supported and as an Amazon Associate, we may earn commissions from qualifying purchases.

Hot Threads

Clicky