theyosh / TerrariumPI

Home automated terrarium/aquarium or other enclosed environment with a Raspberry Pi
https://terrarium.theyosh.nl
GNU General Public License v3.0
402 stars 97 forks source link

[BUG]: Dimming not working as expected #907

Closed cyber-shifter closed 2 months ago

cyber-shifter commented 3 months ago

Setup:

So I've started trying to consolidate my TP3 enclosures to TP4. I have need for one less of the original enclosures, so that freed up a Pi to build the new environment on. This is the same equipment that I had in #512 as far as the dimmer,etc. I did some reading about the new system, setup, etc. According to what I've read, the PID dimming should keep the value here somewhere in the middle between the high and low alarms. Instead though, the value goes up to the low alarm, and then turns off the heat completely. I do not see a minimum dim value anymore, so the panel just drops to 0% and builds up again. The warbling of the temperature would be ok if it was above the low alarm, but it's actually below, and as I understand it, this isn't how it is supposed to work. I've included screenshots, the settings I used were modeled after the setup guide.

Relays Dimmer AreaSettings

theyosh commented 3 months ago

Hi,

can you also post the graph of the sensor 'Fifolet temp'? Because that is the sensor that should control the dimmer PID logic.

theyosh commented 3 months ago

And it possible upload the terrariumpi.log file? It should log the relay changes based on the sensor values. That can help me to analyze this. Your setup seems correct.

cyber-shifter commented 2 months ago

Yeah, I just realized I did a dumb and didn't post the temperature graph. I will get the log as well.

cyber-shifter commented 2 months ago

Temps How much of the log do you want? Time-wise.

theyosh commented 2 months ago

Logging: just 1 day, last logfile should be enough.

cyber-shifter commented 2 months ago

The log file is pretty large. Rather than paste its contents here, I have attached the file. terrariumpi.2024-04-07.log

theyosh commented 2 months ago

Is there any change you have toggled the 'ignore high alarm' on the 'High alarm' tab? Wild guess

cyber-shifter commented 2 months ago

As a matter of fact, yes.

theyosh commented 2 months ago

Toggle that to off... I think that will make it work like expected.

cyber-shifter commented 2 months ago

Ah ha! That did it! image

cyber-shifter commented 2 months ago

Do you have recommendations on how to smooth out the power curve? This looks a lot better than the sawtooth I had before, but I'd like to have as smooth of a power curve as I can, unless you think it isn't going to create problems. I am not so experienced with such power and heating systems.

image

theyosh commented 2 months ago

You could lower the settle time to about 25 seconds. So it will update the relay every update run of TP. Now you have 60 seconds, which will make the relay only change once a minute. So that can be lowered.

And that is it. And a stronger heater could also help, as the dimmer is most of the time at around 100% power. So when it gets colder, there is no spare power left.

cyber-shifter commented 2 months ago

I need to adjust the alarm values because this works differently than it did in TP3. Plus there is a difference between the temperature that the sensor reads and the actual temperature of the substrate (this has to do with the fact that I haven't figured out how to adjust the emissivity setting on the IR sensor). So basically I do trial and error readings with a known good temp good, and what the system says the temp is, and adjust once I figure out the offset. The radiant panel is sized for the enclosures and the animals, I just need to adjust now that I have gotten the whole system working like it is supposed to.

That being said, thank you so much for all your work on this, and for your help to me here. I greatly appreciate it.

theyosh commented 2 months ago

You can add or subtract a value in the offset field in the calibration part of the sensor.

cyber-shifter commented 2 months ago

Yeah, that's what I usually do. It's not perfect, but it functionally works enough to keep the environment steady. I'm going to try what you suggested to smooth out the power.

cyber-shifter commented 2 months ago

The power seems to be smoothing out. But I remembered why the offset wasn't a perfect solution. The difference isn't linear, so I just have to kinda get to a compromise point that works. I'm going to look up some more information about this sensor. The temp gun I have that uses an IR sensor has the ability to change the emissivity, so I'm guessing there is a way to do it for these sensors. It may be something I can code in for the sensor.

cyber-shifter commented 2 months ago

Do you want me to close this issue, since the dimming is behaving as expected and the problem is the particulars of my environment?

theyosh commented 2 months ago

I can close it also. Nice to know that it is working better. And I do understand that an offset is not working for you. So for now I close this issue.