colinl / node-red-contrib-pid

A node-red PID loop controller node intended for the control of real world processes
Apache License 2.0
26 stars 18 forks source link

Controller reset #11

Closed Proamp closed 3 years ago

Proamp commented 4 years ago

It's such a good PID controller. But it doesn't have a very useful reset function (reset an integral part and derivative part). The controller "off" function doesn't do it. For example, you shut down the heater manually (via power switch) but the controller will still collect integral and derivative errors(or will turn on with the collected errors.). It is impossible to startup it clean.

Reset function will be such a good improvement.

colinl commented 4 years ago

I can see that could be useful. If you disable the controller at the same time that you switch the heater off then it will lock the integral at the current value, preventing it winding up. Pull Requests are always welcome.

Proamp commented 4 years ago

But after the next start, I will still have initial errors and don't have any ability for the clean start.

Unfortunately, I'm not so familiar with js)

May be reset controller on every on/off is a good idea? For which reason it memorize accumulated errors?

colinl commented 4 years ago

But after the next start, I will still have initial errors

Can you explain what you mean by that?

May be reset controller on every on/off is a good idea? For which reason it memorize accumulated errors?

If that were done then you would get the opposite effect to that which you don't like. If you switched it into the disabled state (I assume that is what you mean by on/off) for just a short time and back to automatic there would be a kick in the process due to the integral term no longer matching the process conditions.

Proamp commented 4 years ago

As I understand the PID controller principle, we need to accumulate and store 2 things thru time - an integral error and derivative error. After controller on/off those accumulated parameters are still in controller.

I installed and tested many hardware PID controllers and after resetting controller power (for the hardware controller this means zeroing accumulated integral and derivative errors) on the working system we will get only a small deviation in the worse case. It can't be any kick, because of in the heating system(for example) integral part in steady regulation always more than zero, temperature not changed after resetting the controller(very short time), so P-part is still the same cause it = SP(not changed) - MV(not changed), so P+I > P+0, so you will get a little drop of controller output value.

colinl commented 4 years ago

Could you post a chart showing the problem you are seeing. please, so I can better understand the issue. The chart should include the process value and the PID output value.

Proamp commented 4 years ago

Please, pay attention to the chart. Yesterday I reset the controller(restart PC) before start chemical feeding. After I disable chemical feeding w/o stopping the controller for the night and enable chemical feeding in the morning. I'm not changing any controller parameters. SP=0.4, PB=0.4, Integral time = 2000s, Diff time = 60s Look what can do the accumulated integral error with the process. That's why I asked about the controller reset option.

[image: Capture2.PNG]

вт, 11 февр. 2020 г. в 11:20, Colin Law notifications@github.com:

Could you post a chart showing the problem you are seeing. please, so I can better understand the issue. The chart should include the process value and the PID output value.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colinl/node-red-contrib-pid/issues/11?email_source=notifications&email_token=ACHTPJUVBX6CCXZQQHSLHNLRCJNWNA5CNFSM4KOYS2O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLROMQ#issuecomment-584521522, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHTPJUW2DIYFOJFYXKOEQDRCJNWNANCNFSM4KOYS2OQ .

colinl commented 4 years ago

Unfortunately the image does not seem to have appeared, at least I can't see it.

Proamp commented 4 years ago

Please find an image by link below https://i.yapx.ru/GoMYW.png

чт, 12 мар. 2020 г. в 00:35, Colin Law notifications@github.com:

Unfortunately the image does not seem to have appeared, at least I can't see it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/colinl/node-red-contrib-pid/issues/11#issuecomment-597889719, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHTPJRYUOGLGYZYVPO7SITRG772ZANCNFSM4KOYS2OQ .

colinl commented 4 years ago

As I said previously I need to see the PID output value as well as the process value in order fully to understand what is going on. When you get that you should be able to upload it by clicking on the "Attach files ..." link below the field for entering comments. I have not bothered fetching and uploading this one as without the pid output value it is not very helpful without the output value. You did not make it clear whether the controller was put into manual mode when the power was switched off, as it should of course. In fact the best way to switch it off is to put the controller into manual and set the power in the controller.