Jump to content

Geeks only - Raspberry PI controlled kiln


jbruce

Recommended Posts

I'm glad you came here to collaborate, this is a great place do it!  As you know, one of the main reasons developers choose to make their software open source is to draw on the knowledge and abilities of a community to make the project better, the same can be said of the hardware in this case.  I'm excited that this has the potential to turn my manual old 75 dollar kiln into something I can control as well as a newer 2500 dollar kiln.  I'll be doing this project eventually and without you coming here, sharing, and being humble and open to criticism, it just wouldn't happen.  So thank you!  And thank you to everyone else who has contributed here!

Edited by liambesaw
Link to comment
Share on other sites

@jbruce

just my opinion, still a nice project, alpha stage as you say and has brought forward many suggestions. In the end these are all opinions and one can argue often informed by different life experiences and backgrounds.  Folks offering advice based upon their experience is always valuable in my opinion and can help  shed new light on a particular issue or simply be dismissed as being incorrect which usually can be disproven or tested to invalidity.

I am not a big fan of adding exculpatory clauses to everything that I may say or others may say to protect an opinion. I have struggled with this in teaching at the college level in that it tends to stifle creativity, critical thought and the energy to take on new things.

I think sharing your experience and getting quality feedback or opinions from a diverse group has value. Asking moderators to be accountable to correct incorrrect opinions is impossible. Knowingly providing misinformation is key here.

to me you are on a good path and now hopefully will put more energy and research into taking the project to beta stage and folks can continue to provide conscientious criticism or suggestions.

My opinion, project is fine, moderators fine, everyone with a concerned opinion fine. 

Just my thoughts though

 

Link to comment
Share on other sites

1 hour ago, Bill Kielb said:

@jbruce

Asking moderators to be accountable to correct incorrrect opinions is impossible. Knowingly providing misinformation is key here.

 

It's not that we are held accountable, we're just supposed to do our best to make things safe, based on the knowledge we have. We aren't expected to know everything, and the terms of use say to use the information on the forum at your own risk. We're just trying to make it less risky.

@jbruce I still think this is a great project, and like I said before, it's even better because we are discussing the safety issues. Carry on!

Link to comment
Share on other sites

On 1/11/2019 at 3:52 PM, jbruce said:

@High Bridge Pottery Are you deciding if you should turn the relay off or on every 2 seconds?

Yes.  This is a configurable parameter. The code originally made this decision every .5s and that duty cycle was too high for kilns.  I have heard some folks going as high as 10s.  Since it is configurable, you decide the value that works best for your kiln.

How did you come up with the PID values to use?

I read many articles discussing PID tuning.  Some were complex algorithms, some simple.  I tried to find the simplest method that could be done in a few hours.  The process I used is described here... https://github.com/jbruce12000/kiln-controller/blob/master/docs/pid_tuning.md

The tuning it provided the first time around is good for my use.  If you find a simpler, better tact, post a PR and I'll check it out.

I read a few things on pid tuning and was very confused on what to do, the one you posted looks a little easier for kilns specifically. I just ended up using the pid code to read the temperature difference from setpoint + actualtemp with  p=1 i=0 d=0. 

Does 2 seconds not get the relay to cycle on and off a lot? Maybe that has a lot to do with my pid use :lol: I ended up deciding every 60 seconds if the power should be on for 1/6th of the 60 seconds up to 6/6th. That got things to work pretty well and only turn on and off once in 60 seconds.

 

Link to comment
Share on other sites

PID loop tuning is a bit of an art and understanding the thermodynamic lag within a system is helpful. There are several ways to approach this and there has been two basic formulaic approaches  over many years. Many devices with pid control provide auto tune functions. Often a stand alone pid auto tune can be used to develop data that otherwise is tedious to do manually.

an effective article published by Omega engineering is here: https://www.omega.com/temperature/z/pdf/z115-117.pdf

it is generally viewed by those not accustomed to working with these processes as tedious and difficult.

Good PID loop tuners are still hard to find in the real world.

an interesting observation: the Bartlett controller currently in many kilns has an option for SSRs in their gen 700 and above controllers. Their relay cycle time I believe is once every 200 milliseconds. Early on in this thread I asked if these were zero crossing and if so, this along with some reasonable time addded for delays likely establishes the bare minimum switching time.

Tuning a pid is not necessarily how fast your switching loop is,  or how fast you can turn something physically on and off, it is more about the thermodynamics  and thermal inertia of the entire system.

ultimately no matter the method, we do not want significant overshoot, oscillation or excess undershoot.

Edited by Bill Kielb
Link to comment
Share on other sites

@High Bridge Pottery With a cycle time of 2s my controller switches on about 11,000 times in a 13 hour firing.  I'm not sure what "a lot" means to you.  I'm not worried about the number of switching cycles - as long as I keep my SSR cool - it will have a long life.

If you're switching using a mechanical relay or contactor, I would set the cycle time to at least 10s.  I'm not sure about 60s... I'd have to test that.  By experience, my kiln drops a F degree per second when not being heated at 2000 degrees or more.  Setting a cycle time of 60s means the temp swing could be 30-40 degrees or more.  I want to be more precise than this.  I think a 3  degree swing is acceptable.

Edited by jbruce
Link to comment
Share on other sites

A lot to me is just more than my old commercial kiln would click the relays. I am using mechanical relays so I guess it is much easier to hear it. Do you think as long as you can keep it cool then there is not much to worry about with SSR's?

In this picture you can see my test, it does wobble a little on the climb so could be much better but it is pretty close. It does get worse as it goes up and I have never tested past 900c so some tuning is needed. I just had no idea how so bodged this way. The big rise/drop is because I didn't code going from on for 60's to off for 60's right and it stuck on so I pulled the control wire. That setup was one big safety issue in the corner of my bedroom. Only tried once, it gave me a headache. 

421632263_Screenshotfrom2018-05-0122-43-12.png.235ddac7ab5a222379496a4b907f53ab.png IMG_0938.JPG.c68ff783b004f28603bfcf6beac61acc.JPG

 

Edited by High Bridge Pottery
Link to comment
Share on other sites

I think a cooled solid state relay will have long life.  Wear and tear on SSRs is mainly from heating (expansion) / cooling (contraction) of the components in the package.

The increasing amplitude of the waveform as your kiln gets hotter is due to cooling because of the 60s cycle time.  A faster cycle time would be harder on your mechanical relays, but would yield more accurate ramps / soaks.

 

WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!!

  • running a kiln in an enclosed space is extremely dangerous.  some fumes are noxious. please dont.
  • running a kiln within 8 feet of anything flammable is extremely dangerous.  please dont.

WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!!

 

This is the pot calling the kettle black (because I made some mistakes too), but the best thing you could do if you choose to run this in its current location & state is to automate a call to 911 when it starts. :-)

Link to comment
Share on other sites

1 minute ago, jbruce said:

 

WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!!

  • running a kiln in an enclosed space is extremely dangerous.  some fumes are noxious. please dont.
  • running a kiln within 8 feet of anything flammable is extremely dangerous.  please dont.

WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!! WARNING !!!

8 feet eh, I dont think my kiln would fit anywhere on my property haha, my plate says 10 inches from flammables, that's kinda like 8 feet!

Link to comment
Share on other sites

Interesting thought, our gas kilns are in a dock and as such occasionally garbage cans are rolled in waiting to be thrown out which immediately attracts more cardboard boxes, etc... Folks most comfortable with firing have done it so many times often have to be reminded to police this entire are before lighting up one of these kilns. Their comfort level has made them somewhat oblivious. So awareness and training always goes hand in hand with proper design but complacency often leads to true accidents.

Most folks have trouble with ventilation as well so in addition to fumes, they often fail to adequately account for waste heat in an enclosed area. I just went through this issue with a new anagama installed in a barn. Folks just don't have a good idea of the waste heat and heat by radiation is often a giant mystery. We see this with folks who do not understand the major role radiation and conduction play late in firings and how convection becomes very minor until we point out that you can pull a kiln plug at 2000 degrees on your electric kiln and not get a blast of hot air out of it.

When I was teaching I would take an ordinary thermometer and show that as long as the glass bulb could see the glowing element it was recording much higher temperatures than just the ambient air around it. Instant infrared confirmation!

Link to comment
Share on other sites

I shoot for 18 inches from flammable walls, 12 inches from concrete. Wood floors are okay if you put down two layers of cement board that extend at least a foot beyond the edge of the kiln.

I once worked on a kiln at a school that was on a carpeted floor in their paper storage room. We had a nice discussion about not endangering the lives of hundreds of children. The worst part, though, was that the manual for their old kiln didn't say anything about what type of flooring the kiln should sit on.

When I built my gas kiln at my last shop, the fire marshal and building inspector didn't care at all about the safety systems on my kiln burners, probably because it was a concrete free-standing building. What they did care about, however, was the venting system. They considered air quality to be much more of an issue than the flame, because it can hurt/kill you without you realizing it.

Link to comment
Share on other sites

Great project!   I'm really enjoying following along with your progress. ;)    

Just some comments from an artist (not an electrical engineer);   the metal box to me looks very scary if it's not grounded.  My kiln draws ~22 amps and I made sure the exposed metal sides of the kiln has a good ground path to earth that will easily dump enough current to allow the main breaker to go. (checkout ground bond testing)

It looks like the AC power runs very close to the TC cable?   to reduce noise you could try and keep the AC line away from the TC cable and also using a shielded TC cable.   The TC anomalies (open / short) could be linked to the i2c  library?  the library not accounting for clock stretching maybe?    as a workaround you could discard the values and perform another couple of temperature readings after a short delay and only branch your logic if multiple bad readings are present.

When i built my own controller I too was getting noise;  what I did was i took a few TC readings and discarded the upper and lower values,  then I did a check to see if the readings were stable within a +- 1c value;  if not,  I output a buzzer tick noise;  this greatly improved my temperature readings,  and what I noticed was on odd occasions and when my hot water boiler came on the ignition caused a lot of noise on the TC wires,  the noise was enough to throw a reading wildly off, but with the software error correction logic it simply just waits a couple of powerline cycles and takes another series of samples,  this for me works really well. 

When I read up about PID for my own controller I didn't really understand it, so i just rolled my own code;  I can't remember exactly how it works without checking the code but 
the thermal hysteresis for me was only an issue at the kilns lower temperatures,  after the kiln got hot it wasn't an issue, so my code logic just switched to a different mode when the kiln hits a certain temperature.
 

Not sure if that was helpful lol but keep up the great work!

Edited by Ju00Ls
Link to comment
Share on other sites

Might be the only way. He was getting RFI when he logged in to the web server. Typically this high freq. stuff is filtered just ahead of the differential amplifier for the thermocouple. Since this is a board he purchased it would be hard to add your own filter and they should have a scheme in place that filters this out based on the chip series they are using. I believe he tried twisted pair at this point but if MHZ stuff, not likely to be removed by twisted pair.

your way might be a reasonable practical way to ignore the noise.

Edited by Bill Kielb
Link to comment
Share on other sites

@Ju00Ls Hi. Glad you're following and glad you're no longer just a lurker.

The metal box looks scary, but it is grounded. Aluminum boxes are common for electronics projects.  In this case I chose it for its thermal properties and ability to quickly absorb lots of heat and transfer it from the SSR.

The high voltage/high current cable is close to the thermocouple, but I'm not getting noise from that.  The noise I'm seeing comes when a client connects to the server running on the PI.  I believe that connections cause a spike in the processor which draws more current which impacts the 5v power supply connected to the PI.  I think the problem is easily solved by using a larger PI power supply. This is a common PI problem. I have not proven this theory because the TC noise has zero impact on firing.  The primary reason it has not had an impact is that the software reads the TC five times during it's duty cycle (2s by default) and uses the highest value.

PID control is fascinating.  Spend some time up front to tune it, and it stays amazingly close to the set point.  All I keep thinking about is my wife's oven and the fact that it varies like 50F from the set point. To have such fine grained control and oversight of a kiln that a few months ago was just "Low, Medium, High" is awesome and has given me the ability to learn from mistakes faster by gathering lots of evidence with each firing.  Having control over cooling of the kiln is nice too.  I've never worked with crystalline glazes, but I'm already seeing small crystals and more character in the pieces I've glaze fired.  Maybe I'll do crystalline glazes someday.

It's also nice to be able to start a firing automatically on a schedule I choose using the api.  I can also stop and restart at any point in a schedule which has been useful for skipping the last part of a soak you don't need [because the cone is at perfect 90]... or conversely going back to the beginning of a soak because it was about to start cooling and the cone wasn't quite perfect.

I have a 19 lb Maine Coon named Snickers.  What's yours?

Link to comment
Share on other sites

@jbruce     Great stuff!   I only mentioned the ground as I couldn't see any ground in your pic, so I thought I would just mention it.

Yes,  it is such great fun controlling a kiln, the most enjoyable bit for me was the first ever firing,  and taking the pieces out the kiln ;) 

lol, that's a huge cat!   the pic is our Russian blue but we also have Siamese.  

yes, I do tend to "lurk" but only because i'm a bit dyslexic so I don't particularly enjoy reading or writing;   thankfully coding and glancing over a few ic datasheets doesn't really count.  lol

 

Link to comment
Share on other sites

  • 8 months later...

Thanks a lot for your great work on this! Can you give me a hint on how to access the API? I tried to get the know how by reading Github info, but could not get it figured out....

 

edit: mea culpa, just after this post, i found it on Github. If you wonder where to find it: https://github.com/jbruce12000/kiln-controller/blob/master/docs/api.md

 

Edited by KoekenbakkerNL
Link to comment
Share on other sites

This info is for the people who have JBruce's solution or want to make it happen.

I created a little Node Red flow so i get a Telegram message on my phone in case anything happens with my kiln. In short, this gives a telegram message when: 1. The kiln-controller service starts/stops, 2. When and which schedule is started, 3, If a stop command is received, 4, when the schedule is finished.

Besides that, there are 2 other currently unused functions, the current temp and the target temp. I left these out of scope, since i am going to use these values to send them to my home automation dashboard with some other stats.

Some info:

Node Red itself: https://nodered.org/  

Node Red (raspberry howto):  https://nodered.org/docs/getting-started/raspberrypi

Required Node: node-red-contrib-telegrambot-home

How to use this ? 

Get  Node Red up and running, ad the node node-red-contrib-telegrambot-home and restart node red (see howto above). Adjust the text in the "switch" node accordingly to what's in your daemon.log file (tail -f -n 30 /var/log/daemon.log) on your Pi. Since i'm a Dutchman, you probably have to change some values ;-).   For Telegram  you have to use Google, but it's not hard to accomplish. 

After that, you have to import the following flow in Node Red:

[{"id":"5ac7f985.3ec418","type":"tab","label":"Kiln Control Info","disabled":false,"info":""},{"id":"2b57b4be.0c99bc","type":"debug","z":"5ac7f985.3ec418","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":730,"y":180,"wires":[]},{"id":"37f25f28.17203","type":"tail","z":"5ac7f985.3ec418","name":"tail","filetype":"text","split":"[\\r]{0,1}\\n","filename":"/var/log/daemon.log","x":90,"y":200,"wires":[["417cc45c.90389c"]]},{"id":"417cc45c.90389c","type":"switch","z":"5ac7f985.3ec418","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"Stopping kiln-controller","vt":"str"},{"t":"cont","v":"Started kiln-controller","vt":"str"},{"t":"regex","v":"(?<=temp=)[0-9]*.[0-9]","vt":"str","case":false},{"t":"regex","v":"(?<=target=)[0-9]*.[0-9]","vt":"str","case":false},{"t":"regex","v":"INFO oven: Running schedule.*","vt":"str","case":false},{"t":"regex","v":"Stop command received","vt":"str","case":false},{"t":"regex","v":"INFO oven: schedule ended, shutting down","vt":"str","case":false}],"checkall":"true","repair":false,"outputs":7,"x":250,"y":200,"wires":[["3e931766.8cf3b8"],["3832b2a7.b0484e"],["2b57b4be.0c99bc"],["2b57b4be.0c99bc"],["2b57b4be.0c99bc","d23247ab.d57328"],["d23247ab.d57328"],["d23247ab.d57328"]]},{"id":"3832b2a7.b0484e","type":"change","z":"5ac7f985.3ec418","name":"Oven Service gestart","rules":[{"t":"set","p":"payload","pt":"msg","to":"Oven Service gestart","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":140,"wires":[["d23247ab.d57328","2b57b4be.0c99bc"]]},{"id":"3e931766.8cf3b8","type":"change","z":"5ac7f985.3ec418","name":"Oven Service gestopt","rules":[{"t":"set","p":"payload","pt":"msg","to":"Oven Service gestopt","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":100,"wires":[["d23247ab.d57328","2b57b4be.0c99bc"]]},{"id":"d23247ab.d57328","type":"telegrambot-notify","z":"5ac7f985.3ec418","name":"","bot":"xxxx","chatId":"xxxx","message":"","parseMode":"","x":740,"y":260,"wires":[]},{"id":"765afbc.1ab1704","type":"telegrambot-config","z":"","botname":"xxxx","usernames":"","chatIds":"xxxx","pollInterval":"300"}]

If you have any questions, feel free to ask.

Cheers 

Link to comment
Share on other sites

  • 6 months later...

@jbruce I have found this an interesting project and an excuse to see what I can do with an old Raspberry Pi, at the moment all I have is the Pi running the software emulation and I created a profile to roughly match the manually set temperatures and times for a bisque firing. I was surprised at the estimated cost for the firing  but then looked at some of the config settings, they were for a 5.5kW kiln mine is only 3kW, but then there are the other parameters 

im_c_heat     = 100.0  # J/K  heat capacity of heat element
sim_c_oven     = 5000.0 # J/K  heat capacity of oven
sim_p_heat     = 5450.0 # W    heating power of oven
sim_R_o_nocool = 1.0    # K/W  thermal resistance oven -> environment
sim_R_o_cool   = 0.05   # K/W  " with cooling
sim_R_ho_noair = 0.1    # K/W  thermal resistance heat element -> oven
sim_R_ho_air   = 0.05   # K/W  " with internal air circulation

Where can I find estimates for these? its only a small 40l kiln. (Cromartie Hobbycraft KLN40)

Thanks 

Newps

Link to comment
Share on other sites

1 hour ago, newps said:

@jbruce I have found this an interesting project and an excuse to see what I can do with an old Raspberry Pi, at the moment all I have is the Pi running the software emulation and I created a profile to roughly match the manually set temperatures and times for a bisque firing. I was surprised at the estimated cost for the firing  but then looked at some of the config settings, they were for a 5.5kW kiln mine is only 3kW, but then there are the other parameters 

im_c_heat     = 100.0  # J/K  heat capacity of heat element
sim_c_oven     = 5000.0 # J/K  heat capacity of oven
sim_p_heat     = 5450.0 # W    heating power of oven
sim_R_o_nocool = 1.0    # K/W  thermal resistance oven -> environment
sim_R_o_cool   = 0.05   # K/W  " with cooling
sim_R_ho_noair = 0.1    # K/W  thermal resistance heat element -> oven
sim_R_ho_air   = 0.05   # K/W  " with internal air circulation

Where can I find estimates for these? its only a small 40l kiln. (Cromartie Hobbycraft KLN40)

Thanks 

Newps

These are from 2019, maybe private message if he does not respond.

Link to comment
Share on other sites

  • 9 months later...
On 12/18/2018 at 4:11 PM, High Bridge Pottery said:

I found sometimes the MAX31855 spits out NAN when reading the thermocouple. Were they the kind of errors you were getting? @jbruce

Have you seen the MAX31856 chip that can be used with all thermcouple types? https://www.adafruit.com/product/3263

@jbruceIs there any chance you could offer assistance to configure your kiln controller with the max 31856 breakout board instead of the 31855? I really want to use an S-type thermocouple instead of K. Thanks in advance,

Mark (in Sweden)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.