PID Controller turns off Output Lower (0%) despite "Always Min: True" when temperature is below Setpoint #1514
Replies: 10 comments
-
|
I found an issue with the use of incorrect variables for the PWM section of the PID controller. I pushed a potential fix 0a925d3. If you would like to upgrade to master to test the fix, let me know if ti solves the issue. |
Beta Was this translation helpful? Give feedback.
-
|
Hey @kizniche, I updated to the The patch is installed, but the PWM values from the UI are not reaching the new variables in the code. When I set "Min Duty Cycle (Lower)" to 15.0 in the UI, the log shows it's being saved to Because Here is the log showing what the PID controller receives: |
Beta Was this translation helpful? Give feedback.
-
|
Okay, I didn't review the code enough. I reverted my last commit. You'll need to update to master to get that change. Can you provide a screenshot of your PID settings and a log of the PID operating with the PID setting "Log Level: Debug" enabled? |
Beta Was this translation helpful? Give feedback.
-
|
hello!!! I've updated and here are my logs and a screening of the pid
controller settings
[image: image.png]
2026-03-05 06:58:30,313 - INFO - mycodo - All activated Trigger
controllers started
2026-03-05 06:58:30,403 - INFO - mycodo - All activated Input
controllers started
2026-03-05 06:58:30,404 - INFO -
mycodo.controllers.controller_input_d03ef39b - Activated in 63.7 ms
2026-03-05 06:58:30,404 - INFO - mycodo - All activated PID controllers started
2026-03-05 06:58:30,404 - INFO - mycodo - All activated Function
controllers started
2026-03-05 06:58:30,405 - INFO - mycodo.inputs.mqtt_paho_json_d03ef39b
- Connected to localhost as client_r3nW6NXB
2026-03-05 06:58:30,464 - INFO - mycodo.controllers.controller_widget
- Activated in 59.9 ms
2026-03-05 06:58:31,464 - INFO - mycodo - Mycodo daemon started in 1.862 seconds
2026-03-05 07:00:40,009 - INFO -
mycodo.controllers.controller_pid_f72fe7fe - PID Settings: Device ID:
d03ef39b-f020-4c86-9114-dd2ba1cfc48e, Measurement ID:
e32a5ab6-43c1-4135-9974-a27bd49be21b, Direction: lower, Period: 30.0,
Setpoint: 30.0, Band: 0.0, Kp: 1.0, Ki: 0.0, Kd: 0.0, Integrator Min:
-100.0, Integrator Max 100.0, Output Raise: None, Output Raise
Channel: None, Output Raise Type: None, Output Raise Min Amount: 0.0,
Output Raise Max Amount: 0.0, Output Raise Min Off Duration: 0.0,
Output Raise Always Min PWM: False, Output Lower:
7a46425f-ca37-45b2-9f52-499e2b432617, Output Lower Channel: 0, Output
Lower Type: pwm, Output Lower Min Amount: 15.0, Output Lower Max
Amount: 98.0, Output Lower Min Off Duration: 0.0, Output Lower Always
Min PWM: True, Setpoint Tracking Type: , Setpoint Tracking ID:
2026-03-05 07:00:40,009 - INFO -
mycodo.controllers.controller_pid_f72fe7fe - Activated in 135.6 ms
2026-03-05 07:01:10,153 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.69 @ 1970-01-21 15:24:43.265541
2026-03-05 07:01:10,154 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.69,
Output: P: 9.309999999999999, I: 0.0, D: 0.0, Out: 9.309999999999999
2026-03-05 07:01:40,132 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.7 @ 1970-01-21 15:24:43.295542
2026-03-05 07:01:40,132 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.7, Output:
P: 9.3, I: 0.0, D: -0.0, Out: 9.3
2026-03-05 07:02:10,206 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.71 @ 1970-01-21 15:24:43.325544
2026-03-05 07:02:10,207 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.71,
Output: P: 9.29, I: 0.0, D: -0.0, Out: 9.29
2026-03-05 07:02:40,256 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.72 @ 1970-01-21 15:24:43.355549
2026-03-05 07:02:40,256 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.72,
Output: P: 9.280000000000001, I: 0.0, D: -0.0, Out: 9.280000000000001
2026-03-05 07:03:10,124 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.73 @ 1970-01-21 15:24:43.385761
2026-03-05 07:03:10,124 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.73,
Output: P: 9.27, I: 0.0, D: -0.0, Out: 9.27
2026-03-05 07:03:40,194 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.74 @ 1970-01-21 15:24:43.415579
2026-03-05 07:03:40,194 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.74,
Output: P: 9.260000000000002, I: 0.0, D: -0.0, Out: 9.260000000000002
2026-03-05 07:04:10,173 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.75 @ 1970-01-21 15:24:43.445586
2026-03-05 07:04:10,174 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.75,
Output: P: 9.25, I: 0.0, D: -0.0, Out: 9.25
2026-03-05 07:04:40,206 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.76 @ 1970-01-21 15:24:43.475610
2026-03-05 07:04:40,206 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.76,
Output: P: -5.760000000000002, I: 0.0, D: -0.0, Out:
-5.760000000000002
2026-03-05 07:04:40,236 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Setpoint: 15.0, Control
Variable: -5.760000000000002, Output: PWM output
7a46425f-ca37-45b2-9f52-499e2b432617 CH0 to 19.2%
2026-03-05 07:05:10,211 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
20.77 @ 1970-01-21 15:24:43.505788
2026-03-05 07:05:10,212 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 20.77,
Output: P: -5.77, I: 0.0, D: -0.0, Out: -5.77
2026-03-05 07:05:10,242 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Setpoint: 15.0, Control
Variable: -5.77, Output: PWM output
7a46425f-ca37-45b2-9f52-499e2b432617 CH0 to 19.2%
чт, 5 мар. 2026 г. в 01:18, Kyle Gabriel ***@***.***>:
… Okay, I didn't review the code enough. I reverted my last commit. You'll
need to update to master to get that change. Can you provide a screenshot
of your PID settings and a log of the PID operating with the PID setting
"Log Level: Debug" enabled?
—
Reply to this email directly, view it on GitHub
<#1514 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGSRQTHRN6DCCZ3MFIYQ3634PCTSRAVCNFSM6AAAAACWF7AWS2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMBQGI4DIMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Attachments need to be made through the website, attaching to an email reply will not work. |
Beta Was this translation helpful? Give feedback.
-
|
I don't see in your log it setting the Output duty cycle below the 15 minimum you set. Can you show log lines where you see an issue? |
Beta Was this translation helpful? Give feedback.
-
|
2026-03-05 07:24:40,159 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.11 @ 1970-01-21 15:24:44.676321
2026-03-05 07:24:40,159 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.11,
Output: P: 8.89, I: 0.0, D: -0.0, Out: 8.89
чт, 5 мар. 2026 г. в 07:22, Kyle Gabriel ***@***.***>:
… Also set log level debug for the Output and recapture some more log lines,
please.
—
Reply to this email directly, view it on GitHub
<#1514 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGSRQTA56SO6KV35VMLYDQL4PD6JRAVCNFSM6AAAAACWF7AWS2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMBQGUYDQNI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
That's the control varible (8.89), that's not the output duty cycle. The line you would be looking for when the PID sets the duty cycle is as follows, for example: 2026-03-05 07:05:10,212 - DEBUG - |
Beta Was this translation helpful? Give feedback.
-
|
[image: image.png]
2026-03-05 07:47:40,205 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C): 21.69 @
1970-01-21 15:24:46.056926
2026-03-05 07:47:40,205 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.69,
Output: P: 8.309999999999999, I: 0.0, D: -0.0, Out: 8.309999999999999
2026-03-05 07:48:10,179 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.7 @ 1970-01-21 15:24:46.086928
2026-03-05 07:48:10,179 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.7, Output:
P: 8.3, I: 0.0, D: -0.0, Out: 8.3
2026-03-05 07:48:40,159 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.71 @ 1970-01-21 15:24:46.116932
2026-03-05 07:48:40,159 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.71,
Output: P: 8.29, I: 0.0, D: -0.0, Out: 8.29
2026-03-05 07:49:10,231 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.72 @ 1970-01-21 15:24:46.146937
2026-03-05 07:49:10,232 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.72,
Output: P: 8.280000000000001, I: 0.0, D: -0.0, Out: 8.280000000000001
2026-03-05 07:49:40,198 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.74 @ 1970-01-21 15:24:46.176941
2026-03-05 07:49:40,198 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.74,
Output: P: 8.260000000000002, I: 0.0, D: -0.0, Out: 8.260000000000002
2026-03-05 07:50:10,182 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.75 @ 1970-01-21 15:24:46.206947
2026-03-05 07:50:10,182 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.75,
Output: P: 8.25, I: 0.0, D: -0.0, Out: 8.25
2026-03-05 07:50:40,158 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.77 @ 1970-01-21 15:24:46.236844
2026-03-05 07:50:40,159 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.77,
Output: P: 8.23, I: 0.0, D: -0.0, Out: 8.23
2026-03-05 07:51:10,139 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.78 @ 1970-01-21 15:24:46.266851
2026-03-05 07:51:10,139 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.78,
Output: P: 8.219999999999999, I: 0.0, D: -0.0, Out: 8.219999999999999
2026-03-05 07:51:40,202 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.8 @ 1970-01-21 15:24:46.296855
2026-03-05 07:51:40,203 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.8, Output:
P: 8.2, I: 0.0, D: -0.0, Out: 8.2
2026-03-05 07:52:10,179 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.81 @ 1970-01-21 15:24:46.326860
2026-03-05 07:52:10,179 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.81,
Output: P: 8.190000000000001, I: 0.0, D: -0.0, Out: 8.190000000000001
2026-03-05 07:52:40,158 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.83 @ 1970-01-21 15:24:46.356863
2026-03-05 07:52:40,158 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.83,
Output: P: 8.170000000000002, I: 0.0, D: -0.0, Out: 8.170000000000002
2026-03-05 07:53:10,141 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.84 @ 1970-01-21 15:24:46.386873
2026-03-05 07:53:10,141 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.84,
Output: P: 8.16, I: 0.0, D: -0.0, Out: 8.16
2026-03-05 07:53:40,164 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.85 @ 1970-01-21 15:24:46.416881
2026-03-05 07:53:40,165 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.85,
Output: P: 8.149999999999999, I: 0.0, D: -0.0, Out: 8.149999999999999
2026-03-05 07:54:10,144 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.86 @ 1970-01-21 15:24:46.447097
2026-03-05 07:54:10,144 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.86,
Output: P: 8.14, I: 0.0, D: -0.0, Out: 8.14
2026-03-05 07:54:40,218 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - Latest (CH0, Unit: C):
21.87 @ 1970-01-21 15:24:46.477087
2026-03-05 07:54:40,218 - DEBUG -
mycodo.controllers.controller_pid_f72fe7fe - PID: Input: 21.87,
Output: P: 8.129999999999999, I: 0.0, D: -0.0, Out: 8.129999999999999
чт, 5 мар. 2026 г. в 07:28, Kyle Gabriel ***@***.***>:
… That's the control varible (8.89), that's not the output duty cycle. The
line you would be looking for when the PID sets the duty cycle is as
follows, for example:
mycodo.controllers.controller_pid_f72fe7fe - Setpoint: 15.0, Control
Variable: -5.77, Output: PWM output
7a46425f-ca37-45b2-9f52-499e2b432617 CH0 to 19.2%
—
Reply to this email directly, view it on GitHub
<#1514 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGSRQTFM5CDLMFELT57P3Q34PD7ANAVCNFSM6AAAAACWF7AWS2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTMMBQGUYTCMI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Also again, any image attacents you add to an email reply are discarded. You need to post attachments at github.com. The duty cycle was changed to 19.2%. None of your logs have shown the duty cycle being set lower than the minimum 15% you have set. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am setting up a PID controller to manage the climate in a growbox by controlling an exhaust fan via PWM (MQTT Output). The fan is assigned to the Output Lower channel (Cooling).
Because plants require constant fresh air exchange (CO2) and negative pressure for odor control, the exhaust fan must never turn off completely. To achieve this, I set Output Lower Min On to 10.0% and enabled the Output Lower Always Min: True checkbox, which was introduced to solve exactly this in Issue #757.
However, the Always Min setting is completely ignored when the actual temperature drops below the Setpoint.
Here is the log showing the exact PID Configuration, confirming Always Min: True on the Output Lower channel
2026-03-04 00:43:51 - INFO - mycodo.controllers.controller_pid_d475b099 -
PID Settings: Direction: lower, Period: 30.0, Setpoint: 30.0, Kp: 1.0,
Output Lower Type: pwm, Output Lower Min On: 2.0, Output Lower Always Min: True
2026-03-04 00:26:14 - DEBUG - mycodo.controllers.controller_pid_f72cd48b -
Latest (CH0, Unit: C): 23.1 @ ...
2026-03-04 00:26:14 - DEBUG - mycodo.controllers.controller_pid_f72cd48b -
PID: Input: 23.1, Output: P: 1.89, I: 0.0, D: 0.0, Out: 1.89
Beta Was this translation helpful? Give feedback.
All reactions