Reset PID Controller?

Looks like i have the same problem i need a simple PID controller to control my battery charger depending on grid power export so if it is close to 0 any value lower than 0 battery charge current increases and the oposite apply`s. The only PID controller that I got working is: node-red library "node-red-node-pidcontrol" but problem is at night it starts ramping down so integral goes down and in the morning it does not have time to ramp up again ... Is there any way I can modify the node to have max integral value and min integral value so when it reaches this value it stops ?

this is the node:node-red-node-pidcontrol (node) - Node-RED

Welcome to the forum @LucianCLS

Have you read the posts above?

You could try node-red-contrib-pid (I am the author). Its integral locking (which stops integral runaway, which I think is the problem you are seeing) is probably better than in the node you are using.

How often do you get a new reading coming in, and how quickly does the system respond when you make a change?

Hello, thank you for the response, I have tried your PID but could not get it to work like i wanted for your node it outputs a value from 0-1 so i used a range node that transforms it to 0-100 cause 100 is max charge amps but still i get almost on off setting, so i get 0 then 100A .Basicly what I would like is for it to ramp up slower and react a lot slower with low steps like 0.01 per second .

The node that does not lock integral i used range 0-50000 to 0-100 and it worked great but it ramps up or down and can not get it back.

I get a reading every second and system responds in about 2 seconds maybe 3 this is how long the charger takes to ramp up .

What PID settings you have used in the pid node? Did you read the tuning guide linked to from the node's description and attempt to tune it using that method?

I think it works now, the response is what I wanted slow ! the ramp up/down takes 30seconds and i might have to lower it now seems a little to slow but at least it works ! Thank you for the response!

this is what i used :

Setpoint
0
Proportional band
10000
Integral time (secs)
30
Derivative time (secs)
0
Initial integral
0.01
Max sample interval (secs)
2
Derivative smoothing factor
1
Enable state (1=Enabled, 0=Disabled))
1
Output Power when disabled

Do you have the chart showing the input and output of the PID node when you do that? I don't see how the output can alternate 0 and 1 with those settings.

[Edit] Sorry, I did not read the first sentence of your reply, apparently.
To speed it up, start by reducing the PB. Probably halving it each time initially. When you reduce it too much it will start oscillating, so double it again, then bring the Integral time down, maybe to about 3/4 of previous setting each time till it starts overshooting too much. Use a chart showing the pid input and output so you can see what is going on.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.