pvarney / PiLN

Raspberry Pi Kiln Controller
GNU General Public License v3.0
9 stars 1 forks source link

pilnfired.py in Fire() line 206 in your master branch #7

Open BlakeCLewis opened 5 years ago

BlakeCLewis commented 5 years ago

Patrick, if math.isnan(ReadTmp) or ( abs( ReadTmp - LastTmp ) > ( 2 * Window ) ) or ReadTmp == 0 or ReadTmp > 2400: ReadTmp = LastTmp

I am having problems with the second condition '( abs( ReadTmp - LastTmp ) > ( 2 * Window ) )'. It is a comparison of a temp differential to the time segment.  Could you explain what it is for?

With this condition, my fork always reports erroneous temps to the json file.

I thing that 'ReadTmp == 0' would be better 'ReadTmp == 32' or 'ReadCTmp == 0': zero being an error condition of Sensor.readTempC() which CtoF(0) = 32F.

----------------------------------------------

My fork/branch 'https://github.com/BlakeCLewis/MyPiLN' Rearranging, condensing and formatting is my method of trying to understand a program someone else wrote. Switched out the LCD to a pioled from adafruit.com. I plan on abstracting the display into a module or function to make it easier to switch in other displays. The pioled is tiny, but it is what I had. Switched out MySQL for sqilte3. sqlite3 is a very small, with no daemon. Chrome and Firefox use it for settings, history, cookies and more. It is not multi-user friendly as it does table locks to write. I am currently running a headless pi-zero w. I may go to a Pi 3B+ and run the browser locally, or stay with the zero, run X without a manager and auto start the browser full screen. Lighttp and FastCGI may help reduce footprint.

Blake

pvarney commented 5 years ago

Hi Blake. Thanks for reaching out again. It's been a while since I looked at the code (moved to a new house and the kiln isn't hooked up yet). I put that line in to avoid occasional nan and other conditions that would pop up. I think that specific condition was meant to skip over large temperature fluctuations. However, I can't tell you what my thought process was. I want to say that I was shooting for anything greater than 20% difference. But I do remember thinking that a simple percent was not adequate due to how the temperature ramps at lower temps versus higher temps. I'm not sure how using the window variable made sense - it's possible that it's completely arbitrary and worked well for the specific time window I was using. At least now you know the purpose. Let me know if you come up with something better. Do you have your kiln(s) running yet?

BlakeCLewis commented 5 years ago

I have done 2 bisque fires in the jen-ken w/o controller. In the gas conversion kiln, I did a test fire(glaze) with 20lb tank and 1 burner, but iced up at 1080C. I bought 100lb tank, 2 burners and made a few mods, but have not finished to fire again. To your code the biggest change I want to make is add the kiln sitter as a sensor to end the peak segment. Then set the target thermocouple temp at 1 cone higher for safety cut off. I think I understand most of your code. Thanks for making it available. I like the structure. I think I might add htpasswd and https. Another mod: To run a profile, a copy is made and the copy is run. This makes the original usable without having to manually copy the used profile to new runid.

I am a database administrator at the University of Missouri.

On Wed, Nov 28, 2018, 19:33 pvarney <notifications@github.com wrote:

Hi Blake. Thanks for reaching out again. It's been a while since I looked at the code (moved to a new house and the kiln isn't hooked up yet). I put that line in to avoid occasional nan and other conditions that would pop up. I think that specific condition was meant to skip over large temperature fluctuations. However, I can't tell you what my thought process was. I want to say that I was shooting for anything greater than 20% difference. But I do remember thinking that a simple percent was not adequate due to how the temperature ramps at lower temps versus higher temps. I'm not sure how using the window variable made sense - it's possible that it's completely arbitrary and worked well for the specific time window I was using. At least now you know the purpose. Let me know if you come up with something better. Do you have your kiln(s) running yet?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pvarney/PiLN/issues/7#issuecomment-442671931, or mute the thread https://github.com/notifications/unsubscribe-auth/Acm8w_rWuuwB9SyhKEFu8ta32pbvYoohks5uzzlTgaJpZM4Y2IK_ .

pvarney commented 5 years ago

Oh nice! You're not far from me then - I live in Northwest Arkansas and do remote IT work - Primary with Tivoli Storage Manager/Spectrum Protect (IBM's enterprise backup/recovery software). Let me know how it all goes and if you have any more questions.

pvarney commented 5 years ago

So I got my kiln all hooked up and started a test run but was having problem with it showing the right temp. Started looking at the code and ended up at that line you pointed out. I guess I hadn't fully tested that because the logic is just stupid. On the first loop, the LastTmp variable is zero, so that problem statement would be something like: abs ( 60 - 0 ) > ( 2 * 10 ) Which would always be true and therefore always set the ReadTmp to LastTmp which is zero. Thanks for being kind about that. I'm going to remove that part of the if statement for now.

pvarney commented 5 years ago

Also, I noticed I left the logging in debug, which I generally like, but it puts a lot of extra junk in the log when it's not running a profile. To set to info, change this line (line 55): level=L.DEBUG, To: level=L.INFO,

BlakeCLewis commented 5 years ago

pvarney, I have done a few firings in my Skutt ks1027. Old elements, but they are still moving good at cone6. I have new elements, but want to get the repairs and some experimentation done before installing them. I added a gpio pin using the kiln sitter as a sensor, so when the ks triggers, it does the hold time at current temp and then goes on to the next segment (max temp is safety for ks). If it reaches programmed temp first it does the hold at that temp. (ks is safety for max temp). 3 bisque firings and 1 glaze firing. I am using relays, one for each ring, they are same manufacture/series that Skutt sells. DPDT instead of SPDT.

I see that the D is Kd(current_temp - last_temp). I think it should be Kd(current_error - last_error). if error increases, term is +, if error decreases term is -.

Blake

On Wed, Nov 28, 2018 at 7:33 PM pvarney notifications@github.com wrote:

Hi Blake. Thanks for reaching out again. It's been a while since I looked at the code (moved to a new house and the kiln isn't hooked up yet). I put that line in to avoid occasional nan and other conditions that would pop up. I think that specific condition was meant to skip over large temperature fluctuations. However, I can't tell you what my thought process was. I want to say that I was shooting for anything greater than 20% difference. But I do remember thinking that a simple percent was not adequate due to how the temperature ramps at lower temps versus higher temps. I'm not sure how using the window variable made sense - it's possible that it's completely arbitrary and worked well for the specific time window I was using. At least now you know the purpose. Let me know if you come up with something better. Do you have your kiln(s) running yet?