soloam / ha-pid-controller

PID Controller to Home Assistant
MIT License
97 stars 12 forks source link

Can't get PID to work #16

Open VdR1960 opened 2 years ago

VdR1960 commented 2 years ago

Trying the PID in open loop. The output always just tracks the 'minimum'. Nothing else has any influence.

Installed using HACS. Essentially copied the config file. Exposed the input_numbers, input_boolean, and the output to a dashboard (see attached).

Want to use to control my EV charger to use excess solar, by controlling the charger current (PID output) to control the grid current (PID input) and a zero set point.

I'm a controls engineer, I understand the basics of a discrete PID controller. I must be doing something obvious wrong. Any suggestions?

Screenshot 2022-05-05 172924 .

soloam commented 2 years ago

From what i can tell, you are setting the set point to zero and your reading at the moment is -26... That should be the behavior of the inverted PID. Can you set the set point to 26 and select the invert?

VdR1960 commented 2 years ago

I have tried all of that. Positive error, negative error, invert, not invert, K values at zero, K values at max. For several hours now. I also display the P,I and D attributes now, and for life of me cannot make them show anything else than 0.

VdR1960 commented 2 years ago

More trail end error:

When the set point is <=0, the open loop PID output sticks to the min-output whatever you do with the other values. Why?

With the setpoint at 1, the open loop proportional response is fine. But the integral part of the response does not work. There is an initial reaction to the reading step change, but it does not integrate.

soloam commented 1 year ago

Sorry for the delay in response, some personal problems made me be off for some time.

I'll take a look at it.

Tks