Jump to content

Geeks only - Raspberry PI controlled kiln


jbruce

Recommended Posts

16 hours ago, MarkTilles said:

Newsps, i’ve been using the max 31856 for a good year ever since Jason Bruce helped me with the coding. Works great for me, I’m using S thermocouples with both ovens I have connected to my system. I bought the adafruit max31856 card from a reseller here in Europe

Hi Mark, 

Like you I have been using the max31856 with S type thermocouples for about a year, I did have a problem before christmas when during a firing the temperature  appeared to drop drastically,  over 200C and at one point was suggesting the kiln was at 250C but it was glowing redhot through the peephole. Investigation showed that the max31856 was reporting a cold junction fault,  but for a range of reasons that was not being picked up by the pi with the code I was using.

Are you using the version of max31856.py that is on Jason's GitHub? If so where did you get the  Adafruit_GPIO from as its deprecated now ?

I tried to download a copy but could only get a version for Python 2.7, and it did not seem to work with Python 3.7 or 3.9 which is why I have resorted back to my old code and the 2015 Stephen P. Smith version of max31856 rather than the 2109 version by  John Robinson. Part of my earlier problems seems to be my thermocouple offset was -8C  which apparently is a problem for the max31856,  my understanding of the chips data suggested the offset should be between +7C and -7C

 

Link to comment
Share on other sites

2 minutes ago, newps said:

Hi Mark, 

Like you I have been using the max31856 with S type thermocouples for about a year, I did have a problem before christmas when during a firing the temperature  appeared to drop drastically,  over 200C and at one point was suggesting the kiln was at 250C but it was glowing redhot through the peephole. Investigation showed that the max31856 was reporting a cold junction fault,  but for a range of reasons that was not being picked up by the pi with the code I was using.

Are you using the version of max31856.py that is on Jason's GitHub? If so where did you get the  Adafruit_GPIO from as its deprecated now ?

I tried to download a copy but could only get a version for Python 2.7, and it did not seem to work with Python 3.7 or 3.9 which is why I have resorted back to my old code and the 2015 Stephen P. Smith version of max31856 rather than the 2109 version by  John Robinson. Part of my earlier problems seems to be my thermocouple offset was -8C  which apparently is a problem for the max31856,  my understanding of the chips data suggested the offset should be between +7C and -7C

 

You know, to be perfectly honest, I will have a hard time answering your questions. I have basically been cloning the same system since the start that I had working, except for the kiln controller folder. I have been updating that folder now and then from Jasons source but I haven’t done that in probably three or four months now. I’ve just been adding a lot of tweaks for my own use, including the scheduled start which my friend Marko helped me with. If there is some folder that I could zip up for you and send to you, let me know. But I am just hacking my way along.  

Link to comment
Share on other sites

1 hour ago, newps said:

Hi Mark, 

Like you I have been using the max31856 with S type thermocouples for about a year, I did have a problem before christmas when during a firing the temperature  appeared to drop drastically,  over 200C and at one point was suggesting the kiln was at 250C but it was glowing redhot through the peephole. Investigation showed that the max31856 was reporting a cold junction fault,  but for a range of reasons that was not being picked up by the pi with the code I was using.

Are you using the version of max31856.py that is on Jason's GitHub? If so where did you get the  Adafruit_GPIO from as its deprecated now ?

I tried to download a copy but could only get a version for Python 2.7, and it did not seem to work with Python 3.7 or 3.9 which is why I have resorted back to my old code and the 2015 Stephen P. Smith version of max31856 rather than the 2109 version by  John Robinson. Part of my earlier problems seems to be my thermocouple offset was -8C  which apparently is a problem for the max31856,  my understanding of the chips data suggested the offset should be between +7C and -7C

 

Might this help you? Grepped for 31856  

./kiln-controller/lib/max31856.py
./kiln-controller/lib/__pycache__/max31856.cpython-37.pyc

./usr/lib/modules/5.10.63+/kernel/drivers/iio/temperature/max31856.ko
./usr/lib/modules/5.10.63-v8+/kernel/drivers/iio/temperature/max31856.ko
./usr/lib/modules/5.10.63-v7l+/kernel/drivers/iio/temperature/max31856.ko
./usr/lib/modules/5.10.63-v7+/kernel/drivers/iio/temperature/max31856.ko
 

Link to comment
Share on other sites

First,  I want to thank  you all for the knowledge  I've gained reading all 12 pages in this post, and how great it is to see such a long lived and developing project in the works.

I need a  simple kiln controller to do burnout cycles for lost wax casting of silver. i have a paragon firefly that came with a nob and a meter to show temp. I needed ramp/soak programmability, so I grabbed an industrial PID off the internet and rewired the whole thing. But it was so complicated to program that ponce i had my burnout schedule set, i didn't want to use it for anything else which has been bugging me for a long time, as it seems such a waste of such a tool.

I have my kiln, my ssr, rpi4, rp8i t-cobbler for ease of pin access, the max31856 tc amplifier, and my old trusty type-k thermocouple.

I go to https://github.com/jbruce12000/kiln-controller and follow the steps, in order, from the terminal and everything looks like it installs just fine.  When I run the command to start the server, however, I get an error saying that the config file could not be imported and to copy the config.py.example over to the working directory, even though this has been done.

I understand why virtual environments are used, but I intend this to be a dedicated kiln controller, so then tried to install all requirements manually outside the venv (so i could debug line by line and see what I was missing) and run directly from the kiln-controller directory.  this is my result....

pi@raspberrypi:~/kiln-controller $ ./kiln-controller.py
2022-01-24 19:01:18,496 INFO kiln-controller: Starting kiln controller
2022-01-24 19:01:18,498 INFO kiln-controller: this is a real kiln
2022-01-24 19:01:18,498 INFO oven: import MAX31856
2022-01-24 19:01:18,499 INFO oven: init MAX31856
Traceback (most recent call last):
  File "/home/pi/kiln-controller/./kiln-controller.py", line 44, in <module>
    oven = RealOven()
  File "/home/pi/kiln-controller/lib/oven.py", line 381, in __init__
    self.board = Board()
  File "/home/pi/kiln-controller/lib/oven.py", line 47, in __init__
    self.create_temp_sensor()
  File "/home/pi/kiln-controller/lib/oven.py", line 75, in create_temp_sensor
    self.temp_sensor = TempSensorReal()
  File "/home/pi/kiln-controller/lib/oven.py", line 120, in __init__
    self.thermocouple = MAX31856(tc_type=config.thermocouple_type,
  File "/home/pi/kiln-controller/lib/max31856.py", line 127, in __init__
    gpio = Adafruit_GPIO.get_platform_gpio()
  File "/home/pi/.local/lib/python3.9/site-packages/Adafruit_GPIO/GPIO.py", line 426, in get_platform_gpio
    raise RuntimeError('Could not determine platform.')
RuntimeError: Could not determine platform.
pi@raspberrypi:~/kiln-controller $

Something went wrong with my old PID and started flashing boith hi and low alarms and shot to 1350f in about a half hour cracking my mold with a customer piece in it, and I don't want to go back and take a chance with it, but IO have customer pieces to get out.

If you guys can help me in anyway, it would be much appreciated. If you need any data or outputs or logs that I('m not aware of, just say the word.

 

Thanks, Ken

 

Link to comment
Share on other sites

Hi Ken,

My first thoughts are  that the issue is really due to the Max31856 controller not getting set up by the program properly. but that will depend if you have the Adafruit_GPIO module installed and it was working. I can't get it on a totally new build SD card as that module is deprecated. 

My other thoughts are that as you are using a K type thermocouple  the Max31855  tc amplifier would be better,  mainly because I believe  many more of the kiln-controller users  are using the K-type and max31855  set up and the problems with it have been resolved. I have to use the 31856 because I am stuck with a S type thermocouple in my kiln.

It is an interesting thought to use this program for lost wax casting of silver, I would be interested to know more of how you do it. my experience was a small domestic oven to melt the wax out and then  heating the casting flask with a blowtorch before pouring the molten silver into it. 

Link to comment
Share on other sites

Guys I don’t know what the problem is. I just took a fresh installation of pi OS (The default 32-bit Debian Bullseye with desktop option) from the raspberry pi imager, enabled SSH and VNC, connected with  VNC and followed all the set up prompts including updating the system. I next followed Jason’s instructions to the tee. I ran start-on boot, rebooted, and am using the exact same hardware I’ve been using earlier with an S-type thermocouple and my adafruit max31856, everything works perfectly. Could someone be wiring up the interface card wrong? Here’s my sketch connecting the max31856 to my pi zero w, it’s ugly but you get the idea. 
 

Please note: the red lines are where I have cut the traces on my circuit board, so that the wires for those pins go all the way around to the other round two other pins on the pi  6C25085D-0A2F-4119-B786-478E469A9C0C.jpeg.c8bc2e0ccc7037e0b5688a9af0f1d630.jpeg

Edited by MarkTilles
Link to comment
Share on other sites

6 hours ago, newps said:

Hi Ken,

My first thoughts are  that the issue is really due to the Max31856 controller not getting set up by the program properly. but that will depend if you have the Adafruit_GPIO module installed and it was working. I can't get it on a totally new build SD card as that module is deprecated. 

My other thoughts are that as you are using a K type thermocouple  the Max31855  tc amplifier would be better,  mainly because I believe  many more of the kiln-controller users  are using the K-type and max31855  set up and the problems with it have been resolved. I have to use the 31856 because I am stuck with a S type thermocouple in my kiln.

It is an interesting thought to use this program for lost wax casting of silver, I would be interested to know more of how you do it. my experience was a small domestic oven to melt the wax out and then  heating the casting flask with a blowtorch before pouring the molten silver into it. 

I had considered with the '55 just because it was tried and true and been around and used so much, but of course liked the idea of having a more versatile amplifier. I don't steam de-wax normally, and moving into 3d printed castable resins as well as wax, this is going to become less and less of thing I suspect. I have 14 hour burnout cycle.  I start around 150 to finish gloss off of the investment mold, moving to 300 for a few hours to actually lock the mold structure together, at the high end i dwell for around 4 hours at about 1200 to completely burn off any residue and carbonize it, then drop to and hold at 950ish  for several hours to make sure the core temp is at that 950 casting target. The silver goes in the 950 mold at about 1800f. These times are for a medium sized flask, and times can go up or down based on flask size. I have 6 different flask sizes and this is one of the ways easily programming the kiln would be good.

3 hours ago, MarkTilles said:

Guys I don’t know what the problem is. I just took a fresh installation of pi OS (The default 32-bit Debian Bullseye with desktop option) from the raspberry pi imager, enabled SSH and VNC, connected with  VNC and followed all the set up prompts including updating the system. I next followed Jason’s instructions to the tee. I ran start-on boot, rebooted, and am using the exact same hardware I’ve been using earlier with an S-type thermocouple and my adafruit max31856, everything works perfectly. Could someone be wiring up the interface card wrong? Here’s my sketch connecting the max31856 to my pi zero w6C25085D-0A2F-4119-B786-478E469A9C0C.jpeg.c8bc2e0ccc7037e0b5688a9af0f1d630.jpeg, it’s ugly but you get the idea.

Um... I was just trying to set up the software without having the wiring and set up. I was looking at the software and hardware as 2 separate identities. I don't know HOW I didn't realize that that software is going to determine what the hardware is by testing it. I thought the config.py was all it took to set the correct parameters for the build. As soon as I feed my chickens, I am going to re-flash the standard raspbian 32 bit onto my device and start over again looking at your diagram as well as the existing diagrams i was able to find online.

Link to comment
Share on other sites

I wanted to be able to easily replace my max31856 in case of failure and easily connect or disconnect auxiliary devices, so I made a board with socket and pins to connect devices. I have four GPIOs pulled down and two pulled up so I can interface other functions with the outside world more than just the heater control output.  You can see how I am using two single-sided boards mounted opposite each other, was a little tricky but managed to get it working. Having wired in extra GPIO ports also gives me the option of shifting the heating control port to another GPIO in case of one port failure.

 

B761D630-FF3F-4FBA-BA11-DA5CB7F194E4.jpeg

B0ABD6E2-A39C-47FE-9B9D-DE403BE53121.jpeg

Edited by MarkTilles
Link to comment
Share on other sites

I thought my max31856  board was dead so got a new one and it is same. I am not sure that the pinout to the GPIO is critical if the same pinout is on the config.py but this am I am going to revert to Jason's pinout that is not the same as adafruit. May be it was for the  55 board so he kept it and just added the extra pin that the 56 needs. It is an enormous pity that with all the work that went into Jason's project a commercial version that is plug and play wasn't put out. I would be ok about paying for this, although most of the work was pro bono it still needs work for a commercial product. 

If I can get my set to work I will use it as a monitor until I see how reliable it is. My kiln is in my garage and not next to my inflammable! I have found with my incremental power arrangement I only need to change settings every 30 minutes due the thermal inertia and great insulation.  

 

Link to comment
Share on other sites

Personally I’m using GPIO 17. But I can also use 16, 22 or 27 which I’ve also wired in and am currently blinking LEDs and switching SSR relays on for fun! I still need to finish designing and then print out a new chassis to put everything into before I swap this one out with my current production unit.  I’m also waiting for an electromagnet lock mechanism to put into my ceramic room door jamb :-)

Link to comment
Share on other sites

Just now, rondoc said:

Off topic...If you use AC for your door lock it will buzz. I had one and to get rid of buzzing I rectified the AC and added a capacitor to smooth out the ripples. Nice and quiet now.

Good point, but I’m waiting for a 12 V DC electromagnet version, and I’m going to run it from an old computer power supply have in the garage.

Link to comment
Share on other sites

13 minutes ago, silfrsmithr said:

Okay so I did this again to no avail. Does this look correct?  I show my results when changing from simulated to non simulated as well as changing my '55 and '56 flags.

 

 

20220125_124754.jpg

20220125_124730.jpg

Screenshot from 2022-01-25 12-41-17.png

In my ugly sketch above, I show the PIN numbers of the pi zero w,  not GPIO numbers on the top. Below on each pin definition on the Max  board I mentioned the GPIO numbers these connections represent. Vän here is my config file except for my heating GPIO
 

### Thermocouple Adapter selection:
#   max31855 - bitbang SPI interface
#   max31856 - bitbang SPI interface. must specify thermocouple_type.
max31855 = 0
max31856 = 1
# see lib/max31856.py for other thermocouple_type, only applies to max31856
thermocouple_type = MAX31856.MAX31856_S_TYPE

### Thermocouple Connection
gpio_sensor_cs = 5
gpio_sensor_clock = 11
gpio_sensor_data = 9
gpio_sensor_di = 10 # only used with max31856

Edited by MarkTilles
Link to comment
Share on other sites

1 hour ago, MarkTilles said:

When I traced you were colors between your pins, your wiring looks nothing like I have in my ugly sketch above, why don’t you see if my wiring doesn’t work for you OK.

My breakout board for the gpio pins on the rpi don't match your drawing's pins, if I'm reading it correctly. example... your CS from the MAX connects to GPIO 5, which is the 17th pin on the RPI...however that pin on my breakout is listed as a 3.3v on the cobbler., and that cant be right?

I guess I don't understand your diagram or the direct relation to my pins.

 

I appreciate the help very much btw.

 

EDIT I JUST saw your clarification post, and I'll work through this and see how it goes and post back.

Edited by silfrsmithr
posting replies at the same time
Link to comment
Share on other sites

18 minutes ago, silfrsmithr said:

Still no go. I think I have this wired the same as yours. I also order a MAX81355, but it's going to take a minute to get here.

 

this4.jpg

this.jpg

Looks to me like some of your solder joints are VERY cold. I would bet your problem lies right there. You might want to recheck them, maybe desolder and put on new solder with some flux. 

E50887FF-DC61-4914-A3D7-44953E3B3F55.jpeg

Edited by MarkTilles
Link to comment
Share on other sites

Just went back and cleaned up my solder joins. Still nothing. If i use the terminal commands for production use, I can run the simulated. Otherwise, it's still not finding which board platform I'm using.

(venv) pi@raspberrypi:~/kiln-controller $ source venv/bin/activate; ./kiln-controller.py
2022-01-25 17:16:03,566 INFO kiln-controller: Starting kiln controller
2022-01-25 17:16:03,569 INFO kiln-controller: this is a real kiln
2022-01-25 17:16:03,569 INFO oven: import MAX31856
2022-01-25 17:16:03,570 INFO oven: init MAX31856
Traceback (most recent call last):
  File "/home/pi/kiln-controller/./kiln-controller.py", line 44, in <module>
    oven = RealOven()
  File "/home/pi/kiln-controller/lib/oven.py", line 381, in __init__
    self.board = Board()
  File "/home/pi/kiln-controller/lib/oven.py", line 47, in __init__
    self.create_temp_sensor()
  File "/home/pi/kiln-controller/lib/oven.py", line 75, in create_temp_sensor
    self.temp_sensor = TempSensorReal()
  File "/home/pi/kiln-controller/lib/oven.py", line 120, in __init__
    self.thermocouple = MAX31856(tc_type=config.thermocouple_type,
  File "/home/pi/kiln-controller/lib/max31856.py", line 127, in __init__
    gpio = Adafruit_GPIO.get_platform_gpio()
  File "/home/pi/kiln-controller/venv/lib/python3.9/site-packages/Adafruit_GPIO/GPIO.py", line 426, in get_platform_gpio
    raise RuntimeError('Could not determine platform.')
RuntimeError: Could not determine platform.
(venv) pi@raspberrypi:~/kiln-controller $

I am at a loss.

Link to comment
Share on other sites

What country are you in? My only thought is to send your board to someone else that has a working system to plug it in and see if it works there. I suspect the hardware. Like I said, I followed Jason’s instructions to the tee and had absolutely no trouble getting my clean test install to work.
 

You might also try without using the hat, or try using a complete second set of cables, every connection you make is a potential connection point that could go wrong.

Link to comment
Share on other sites

1 hour ago, silfrsmithr said:

Still no go. I think I have this wired the same as yours. I also order a MAX81355, but it's going to take a minute to get here.

 

this4.jpg

this.jpg

Interesting I have same setup and I only get 32F and stuck for temperature , even after a reboot.  This same with 2 of adafruit boards. I am now starting from scratch...new format on SD CARD.

and following Jason completely.

I wonder if the GPIO is somehow setup wrong. I tried the GPIO TEST that Jason gives to view all the pins but it didn't run on my raspberry. 3B only the 4. All a bit frustrating almost as bad as learning to throw many moons ago.

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.