Understanding the PID function

Im trying to understand the VPD function. Why would it continue to try to lower the VPD, even after it drops below the setpoint? I’m still testing, to I only have a P gain at the moment. In a normal PID I’ve would expect output to be 0 below setpoint (when lowering). Maybe I’m missing something here.

What do you mean by “VPD Function”? I see a partial set of options for a PID Controller.

Please do the following: turn off data grouping for your graph series, add the PID P-Value and PID Output (Duration) series to the graph, and show all options of the PID controller.

Its just the PID controller yes, don’t know why I though it was special to VPD.

Can you unhide the PID Output (Duration) series on the graph? I need to see them all on the graph.

Here we go


chart.txt (323.2 KB)

Did you turn data grouping off?

Like this, right?
image

That looks good. Thanks for providing the graph, though I can’t really understand for sure there’s an issue unless you provide one more piece. I’ll need you to enable debug mode and provide some log lines from only the PID controller during a time you can identify when the VPD is below 1000 Pa (ideally far below 1000) and the controller is still attempting to turn on the Output. Are your PID controller settings still current for the last graph you provided?

Yes, didn’t change any settings. Still just a P value of 0.15

So, looking at this period it seems to basically be overshooting quite a bit. Its like the feedback to the controller is delayed. For instance the VPD rises to above 1000 around 15:50 and the controller kicks in. The VPD quickly drops, but the controller keep thinking the error is still positive for another 15 minutes.

I started the debug log now, is there an easy way to extract the log for a given time span?

image

Edit. Looking at the P value versus the VPD only, I dont understand why its so stable, even though the VPD is fluctuating so much

This is why we need the debug information. You’ll just need to look at the Daemon Log and extract the relevant lines. Turn off all other debug logging to make it easier.

Sure, I was just curious if it let it run for some time, what the easiest way to search the log was. Anyway here are some lines. Btw. why is it calculating every second? (Period is set to 60sec), also why is the duty cycle 5 min (Output duration on the chart is a log point every 5 min with a duration of 1-300 dec)

2021-06-01 21:55:48,347 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1225.9245773364175 @ 2021-06-01 21:55:44
2021-06-01 21:55:48,348 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1225.9245773364175, Output: P: -48.88868660046263, I: -0.0, D: 0.0, Out: -48.88868660046263
2021-06-01 21:55:48,493 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -48.88868660046263 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 21:56:48,336 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1227.8023975227325 @ 2021-06-01 21:56:44
2021-06-01 21:56:48,337 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1227.8023975227325, Output: P: -49.17035962840987, I: -0.0, D: -0.0, Out: -49.17035962840987
2021-06-01 21:56:48,550 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -49.17035962840987 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 21:57:48,341 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1221.2392869515481 @ 2021-06-01 21:57:44
2021-06-01 21:57:48,342 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1221.2392869515481, Output: P: -48.18589304273222, I: -0.0, D: 0.0, Out: -48.18589304273222
2021-06-01 21:57:48,440 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -48.18589304273222 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 21:58:48,406 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1222.8327734392847 @ 2021-06-01 21:58:44
2021-06-01 21:58:48,407 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1222.8327734392847, Output: P: -48.4249160158927, I: -0.0, D: -0.0, Out: -48.4249160158927
2021-06-01 21:58:48,523 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -48.4249160158927 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 21:59:48,349 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1205.707284740124 @ 2021-06-01 21:59:44
2021-06-01 21:59:48,350 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1205.707284740124, Output: P: -45.85609271101858, I: -0.0, D: 0.0, Out: -45.85609271101858
2021-06-01 21:59:48,568 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -45.85609271101858 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:00:48,365 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1198.7074828134564 @ 2021-06-01 22:00:44
2021-06-01 22:00:48,366 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1198.7074828134564, Output: P: -44.80612242201846, I: -0.0, D: 0.0, Out: -44.80612242201846
2021-06-01 22:00:48,499 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -44.80612242201846 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:01:48,366 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1192.4195011834338 @ 2021-06-01 22:01:44
2021-06-01 22:01:48,366 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1192.4195011834338, Output: P: -43.862925177515066, I: -0.0, D: 0.0, Out: -43.862925177515066
2021-06-01 22:01:48,513 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -43.862925177515066 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:02:48,318 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1190.9921889858304 @ 2021-06-01 22:02:44
2021-06-01 22:02:48,319 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1190.9921889858304, Output: P: -43.64882834787455, I: -0.0, D: 0.0, Out: -43.64882834787455
2021-06-01 22:02:48,577 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -43.64882834787455 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:03:48,372 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1183.0321279255345 @ 2021-06-01 22:03:44
2021-06-01 22:03:48,373 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1183.0321279255345, Output: P: -42.45481918883017, I: -0.0, D: 0.0, Out: -42.45481918883017
2021-06-01 22:03:48,556 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -42.45481918883017 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:04:48,383 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1180.2844646183714 @ 2021-06-01 22:04:44
2021-06-01 22:04:48,384 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1180.2844646183714, Output: P: -42.042669692755716, I: -0.0, D: 0.0, Out: -42.042669692755716
2021-06-01 22:04:48,595 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -42.042669692755716 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:05:48,315 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1172.5685772699844 @ 2021-06-01 22:05:44
2021-06-01 22:05:48,316 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1172.5685772699844, Output: P: -40.885286590497664, I: -0.0, D: 0.0, Out: -40.885286590497664
2021-06-01 22:05:48,489 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -40.885286590497664 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:06:48,315 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1174.8295633488997 @ 2021-06-01 22:06:44
2021-06-01 22:06:48,316 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1174.8295633488997, Output: P: -41.22443450233495, I: -0.0, D: -0.0, Out: -41.22443450233495
2021-06-01 22:06:48,522 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -41.22443450233495 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:07:48,329 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1170.52266573114 @ 2021-06-01 22:07:44
2021-06-01 22:07:48,330 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1170.52266573114, Output: P: -40.578399859671, I: -0.0, D: 0.0, Out: -40.578399859671
2021-06-01 22:07:48,579 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -40.578399859671 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1

All of the lines you provided show the pressure well above 1000 Pa. I need lines demonstrating the issue, where the Pa is significantly lower than the setpoint and the Output is above 0.

I believe you’re mistaken. I see it running only every 60 seconds.

This is something you’ll need to verify by exporting the Output measurement data from the Import/Export page.

I was mistaken, its every 60 sec of course. And looking at the export, would this indicate that the relay duration is set every minute also?

image

I cant get the VPD down below 1000 at the moment. I’ll have a look at it tomorrow and observe the log meanwhile.

Yes, I see the timestamps are 1 minute apart.

Zoom in on the graph and see if the resolution for the PID Output increases.

Also, it could be beneficial to include the Output Duration on the graph as well, as sometimes the PID Output does not always align with the actual Output Duration (since you have Minimum On set to 10 seconds and a Period of 60 seconds, this limits the Output).

At 22:58 the input is lower than the setpoint and the controller still has an output. I see that it doesn’t kick in until it exceeds the dead band, that makes sense. But is it also aiming for the lower dead band (1000-900)?

Also, what is happening the last couple of minutes? It keeps setting the output to the same value as last time PID line in the log

2021-06-01 22:57:10,287 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1085.8842429617494 @ 2021-06-01 22:56:59
2021-06-01 22:58:10,314 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1119.8296918253723 @ 2021-06-01 22:57:59
2021-06-01 22:58:10,315 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1119.8296918253723, Output: P: -32.97445377380584, I: -0.0, D: 0.0, Out: -32.97445377380584
2021-06-01 22:58:10,591 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -32.97445377380584 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 22:59:10,269 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 978.8163788506907 @ 2021-06-01 22:58:59
2021-06-01 22:59:10,270 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 978.8163788506907, Output: P: -11.822456827603611, I: -0.0, D: 0.0, Out: -11.822456827603611
2021-06-01 22:59:10,484 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -11.822456827603611 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:00:10,282 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1083.7064446887935 @ 2021-06-01 22:59:59
2021-06-01 23:00:10,283 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1083.7064446887935, Output: P: -27.55596670331902, I: -0.0, D: -0.0, Out: -27.55596670331902
2021-06-01 23:00:10,412 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -27.55596670331902 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:01:10,266 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 939.3406811277009 @ 2021-06-01 23:00:59
2021-06-01 23:01:10,267 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 939.3406811277009, Output: P: -5.901102169155138, I: -0.0, D: 0.0, Out: -5.901102169155138
2021-06-01 23:02:10,272 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 1162.0755100428753 @ 2021-06-01 23:01:59
2021-06-01 23:02:10,272 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - PID: Input: 1162.0755100428753, Output: P: -39.31132650643129, I: -0.0, D: -0.0, Out: -39.31132650643129
2021-06-01 23:02:10,486 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -39.31132650643129 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:03:10,287 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 839.7041906848442 @ 2021-06-01 23:02:59
2021-06-01 23:03:10,506 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -39.31132650643129 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:04:10,295 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 735.6921339918703 @ 2021-06-01 23:03:59
2021-06-01 23:04:10,421 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -39.31132650643129 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:05:10,278 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 717.5160968776008 @ 2021-06-01 23:04:59
2021-06-01 23:05:10,491 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -39.31132650643129 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1
2021-06-01 23:06:10,310 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Latest (CH4, Unit: Pa): 698.3581113951486 @ 2021-06-01 23:05:59
2021-06-01 23:06:10,525 - DEBUG - mycodo.controllers.controller_pid_714ce3bd - Setpoint: 1000.0 Output: -39.31132650643129 sec to output 612d6f7a-714b-4af0-8f86-14a4611c5198 CH1

I don’t know what you’re asking. If you have a setpoint of 1000 and a band of 100, the PID will continue to produce an output (if only Kp is set) until the measurements fall below 900.

The PID controller will always continue to operate, but it will not always actually turn on the output. I mentioned previously that you should enable the Output Duration on the graph for precisely this reason, as the PID Output is not always indicative of the Output Duration…

You can also enable debug mode for the particular output and it will appear in the log next to the PID lines when it actuates.