Mycodo icon indicating copy to clipboard operation
Mycodo copied to clipboard

PID is not controlling output

Open BearBrew opened this issue 3 years ago • 2 comments

New install to control a mini-fridge for beer fermentation purposes. Have a DHT22 temperature sensor that MyCodo is able to read and keep history. Using Raspberry Pi GPIO pins 23/24 to control a solid state relay, model by SainSmart. One input and 2 outputs placed in MyCodo and MyCodo is able to MANUALLY toggle the output relays. I placed a PID with a set point, however it never automatically toggles the output even when the setpoint is reached. Looking at the logs, I have this:

2022-07-03 14:40:46,478 - DEBUG - mycodo.controllers.controller_pid_415c28f1 - Latest (CH0, Unit: F): 66.74 @ 2022-07-03 14:40:36 2022-07-03 14:40:46,479 - DEBUG - mycodo.controllers.controller_pid_415c28f1 - PID: Input: 66.74, Output: P: -6.239999999999995, I: -0.0, D: 0.0, Out: -6.239999999999995 2022-07-03 14:41:07,013 - DEBUG - mycodo.controllers.controller_input_d649448b - Adding measurements to InfluxDB with ID d649448b-dfb0-448c-a218-8f18d36d662b: {0: {'measurement': None, 'unit': 'F', 'value': 66.74, 'timestamp_utc': datetime.datetime(2022, 7, 3, 18, 41, 6, 974163)}, 1: {'measurement': 'humidity', 'unit': 'percent', 'value': 99.4, 'timestamp_utc': datetime.datetime(2022, 7, 3, 18, 41, 6, 974185)}} 2022-07-03 14:41:16,456 - DEBUG - mycodo.controllers.controller_pid_415c28f1 - Latest (CH0, Unit: F): 66.74 @ 2022-07-03 14:41:07 2022-07-03 14:41:16,457 - DEBUG - mycodo.controllers.controller_pid_415c28f1 - PID: Input: 66.74, Output: P: -6.239999999999995, I: -0.0, D: 0.0, Out: -6.239999999999995

Looks to me like it reads the input and compares the values but just never does anything with it. What am I missing?

  • Mycodo Version: 8.13.10
  • Raspberry Pi Version: 3B
  • Raspbian OS Version: Bullseye Lite

BearBrew avatar Jul 03 '22 18:07 BearBrew

A PID is also not recommended for fridge/freezer control unless you really know what you're doing with a PID or you'll likely damage your fridge/freezer. A Bang-Bang Function is the preferred method.

kizniche avatar Jul 03 '22 20:07 kizniche

OK,  I will try that then.   What do you use on the dashboard?  I mean how do you set the setpoint

⁣Get BlueMail for Android ​

On Jul 3, 2022, 4:02 PM, at 4:02 PM, Kyle Gabriel @.***> wrote:

A PID is also not recommended for fridge/freezer control unless you really know what you're doing with a PID or you'll likely damage your frisge/freezer. A Bang-bang Function is the preferred method.

-- Reply to this email directly or view it on GitHub: https://github.com/kizniche/Mycodo/issues/1207#issuecomment-1173162504 You are receiving this because you authored the thread.

Message ID: @.***>

BearBrew avatar Jul 03 '22 21:07 BearBrew

There isn't currently a widget to change a Bang-Bang setpoint, so you'll have to do that from the Function page (or create a custom Widget to do that and add a helper function in the Bang-Bang Function to receive that command and change the setpoint).

kizniche avatar Oct 10 '22 17:10 kizniche