Node-red-contrib-pid delete I-contribution

Hi everyone,

I'm using the node-red-contrib-pid and that works quite well.

My heating system has long heat up times (20min to 2hr).
During the heating period, the I-contribution gets summed up and while reaching the setpoint the I-contribution is too high for the actual temperature and I get a large overshoot.

I worked with two pid controllers, one P-controller for the heating and one PI-controller for the stabilization period.
But as soon as the 2nd (PI) controller is switched on, the latest (random) I-contribution is still active and gets part of the control process and I get a large overshoot.

I tried different workarounds but it all comes down to the latest stored I-contribution in the pid-controller.
Is there a way to set and/or delete the active I-contribution?
Or is there another way of solving the problem?

Regards Jan

That should not happen if the loop is correctly tuned. There is a tuning guide linked from the node's page on the node red flows site. If you have not already worked through that then it is probably worth doing so.

Again, that should not be necessary if the loop is correctly tuned. Get rid of the second pid node, it will not be necessary.

If you believe that it is correctly tuned, but you still get the overshoot then show us a chart showing the output of the pid node and also the current temperature, during the startup and stabilisation. You may have to scale the power output so that it appears correctly on the chart.

If your heating system have long heat up time then I-time can be turned off by putting it to a very high value as you do not really need it for slow moving systems. So you only need your P controller pid and nothing else

node-red-contrib-pid has integral locking when the temperature is well away from the setpoint in order to prevent integral windup.

Without an appropriate I setting the process will take a very long time to settle exactly onto the setpoint.

If it is for room heating (which i assume) i think he is better off just using P-controller for simplicity. That is atleast what im doing, and that works very well.

P band around 3, and I-time to very high value. Initial integral at 0 of course.

Without tuning the loop correctly and seeing the result it is impossible to know what would be best in any particular case.

@ Colin, @ pandoras_node

Thanks for your advice. I tuned the PID controller already but at first, I try to do the PID tuning again and keep some records. It will take me a couple of days to do it.

Feel free to post the results as you go and I will offer advice.

Sorry about the delay but I didn't have the time to perform the test. I will do it in the near future.

Hi Jan,

It sounds like you're dealing with a classic issue in PID control, especially in systems with long heat-up times. Here are some suggestions to manage the integral contribution and mitigate overshoot:

  1. Reset Integral Windup: If the node-red-contrib-pid allows it, look for a method to reset the integral term when switching between controllers. This could be done by manually setting the integral value to zero in your PI controller when it takes over.
  2. Anti-Windup Strategies: Implement an anti-windup mechanism. This can involve clamping the integral contribution within a specific range or only allowing the integral to accumulate when the error is within a certain threshold.
  3. Gain Tuning: Experiment with tuning the PID gains, particularly the integral gain. Lowering the integral gain can help reduce overshoot, though it may slow the system's response.
  4. Using Conditional Logic: Use a function node to manage the transitions between your P and PI controllers. You can switch the control strategy based on the current state of the system, ensuring that the I-contribution is handled appropriately.
    If you provide more details about your current implementation, I might be able to suggest more specific changes. Good luck! for better understanding come to this site https://iqratechnology.com/

node-red-contrib-pid includes logic to prevent integral windup. Resetting the integral is unlikely to be necessary.

Again, such logic is already implemented in the node.

Such strategies should not be necessary with an approximately linear process such as simple heating. It can be necessary with significantly non-linear processes such as exothermic reactions where the transfer function of the process changes significantly dependent on the current conditions.

You missed out the true number 1, which is to make sure the PID loop is optimally tuned. If it is then other strategies are rarely necessary.