How to PID reset the accumulated values ?

Anbindung von FS20-Komponenten, ELV-Wetterstationen, EnOcean und DMX an HomeMatic

Moderator: Co-Administratoren

Antworten
prismatic
Beiträge: 4
Registriert: 23.11.2024, 10:39
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 1 Mal

How to PID reset the accumulated values ?

Beitrag von prismatic » 23.11.2024, 10:56

Dear forum,

I use PID regulation for my floor heating since its inception in CUxD (before that I had my own custom implementation).

This used to work great but this year with latest 2.12 for some reason it does not and logs shows nothing that could help me understand the problem root cause.

I suspect accumulation might be slightly off and I would like to clean it (this is the i and op values below). Does anyone know how to do it without creating a completely new 9002-Thermostat device ?

FYI weather|reset does not reset this part although I have the feeling it used to do so...

Code: Alles auswählen

CUX9002006:	mode(3) pid(xp:10.00 tn:1800s tv:540s tz:360s -> i:-127.50 op:6.00 min:0.00% max:100.00%) T h(0.10)
	CUX9002006:1	CCU(WEATHER_TRANSMIT,'LEQ0418212:1') STAT CHECK
	CUX9002006:2	CCU(THERMALCONTROL_TRANSMIT,'LEQ0418212:2')
	CUX9002006:3	tz(1200) min(120)
			CMD-true(/usr/local/addons/cuxd/extra/timer.tcl BidCos-RF.KEQ0844307:1.STATE 1 0 0 $ONTIME$)

Benutzeravatar
uwe111
Beiträge: 4858
Registriert: 26.02.2011, 22:22
Hat sich bedankt: 3 Mal
Danksagung erhalten: 256 Mal
Kontaktdaten:

Re: How to PID reset the accumulated values ?

Beitrag von uwe111 » 24.11.2024, 18:11

Hi
prismatic hat geschrieben:
23.11.2024, 10:56
This used to work great but this year with latest 2.12 for some reason it does not and logs shows nothing that could help me understand the problem root cause.
There was no change in PID regualtion code lately. So the regulation behaviour between the last CUxD versions should be the same.
prismatic hat geschrieben:
23.11.2024, 10:56
I suspect accumulation might be slightly off and I would like to clean it (this is the i and op values below).
I never got a request like that and I'm not a PID controller expert. But since the controller is supposed to bring the actual value of the system to the desired setpoint value, I don't know what the point of cleaning internal variables would be.
Maybe your XP, TN, TV and TZ parameters need to be adjusted?
prismatic hat geschrieben:
23.11.2024, 10:56
FYI weather|reset does not reset this part although I have the feeling it used to do so...
It never did that before.

Greetings

Uwe
Alle sagten: Das geht nicht. Dann kam einer, der wußte das nicht und hat's einfach gemacht.
SPENDEN :wink: Download: CUxD 2.12, SSH KeyDir

prismatic
Beiträge: 4
Registriert: 23.11.2024, 10:39
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 1 Mal

Re: How to PID reset the accumulated values ?

Beitrag von prismatic » 25.11.2024, 10:06

Hi Uwe,

Thanks for quick reply. I think the problem was actually the usage of timer.tcl cmd when using $ONTIME$. Did a change occured there ? Could a transmission issue on one channel affect the others ? I switched to the variant with explicit STATE to 0 and PID controlling is working again.

Clearing the internal PID state offers a practical way to accelerate recovery after an error/abnormal condition. Examples of such conditions might include a defective valve, the main water heating system failing to supply hot water, or a rapid shift to extremely cold weather following a prolonged hot period. In these scenarios, the integral term in the PID controller is usually significantly misaligned and going back to 0 might be a bit closer to the desired value.

By resetting the internal state, particularly the integral term, the controller can adapt more rapidely to the current conditions without being hindered by outdated or irrelevant accumulated errors. Adjusting the algorithm parameters like you suggest might imply to making the system possibly instable in normal situation which is not desirable.

Benutzeravatar
uwe111
Beiträge: 4858
Registriert: 26.02.2011, 22:22
Hat sich bedankt: 3 Mal
Danksagung erhalten: 256 Mal
Kontaktdaten:

Re: How to PID reset the accumulated values ?

Beitrag von uwe111 » 27.11.2024, 18:52

prismatic hat geschrieben:
25.11.2024, 10:06
I think the problem was actually the usage of timer.tcl cmd when using $ONTIME$. Did a change occured there ?
No, timer.tcl didn't change lately.
You could log your exec calls to a file and check the $ONTIME$ values to verify if it works right.
prismatic hat geschrieben:
25.11.2024, 10:06
By resetting the internal state, particularly the integral term, the controller can adapt more rapidely to the current conditions without being hindered by outdated or irrelevant accumulated errors.
I have to check if I can implement a way to adjust the internal states with next CUxD update.

Uwe
Alle sagten: Das geht nicht. Dann kam einer, der wußte das nicht und hat's einfach gemacht.
SPENDEN :wink: Download: CUxD 2.12, SSH KeyDir

prismatic
Beiträge: 4
Registriert: 23.11.2024, 10:39
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 1 Mal

Re: How to PID reset the accumulated values ?

Beitrag von prismatic » 27.11.2024, 19:44

Hi Uwe,

Thanks for the reply.

Before switching to the other method, I checked the $ONTIME$ value by using a non-existent command to view it in the logs, and it appeared to be correct.

Still unsure what happen exactly and it is not easy to test in real situation. If I ever got the time, I should probably build a small heater controller to test in various situation and error conditions.

A reset option would be really helpful.

Benutzeravatar
uwe111
Beiträge: 4858
Registriert: 26.02.2011, 22:22
Hat sich bedankt: 3 Mal
Danksagung erhalten: 256 Mal
Kontaktdaten:

Re: How to PID reset the accumulated values ?

Beitrag von uwe111 » 02.12.2024, 21:32

prismatic hat geschrieben:
27.11.2024, 19:44
A reset option would be really helpful.
I checked the CUxD Documentation and found on page 88 that you can reset i and p parameters when you toggle the INVERT device parameter or SET_INVERT datapoint twice.
So change INVERT from [ ] to [x], save it, change it back from [x] to [ ] and save it. That should do the job.

Uwe.
Alle sagten: Das geht nicht. Dann kam einer, der wußte das nicht und hat's einfach gemacht.
SPENDEN :wink: Download: CUxD 2.12, SSH KeyDir

prismatic
Beiträge: 4
Registriert: 23.11.2024, 10:39
System: Alternative CCU (auf Basis OCCU)
Hat sich bedankt: 1 Mal

Re: How to PID reset the accumulated values ?

Beitrag von prismatic » 03.12.2024, 08:24

Nice trick indeed, thanks for sharing.

Antworten

Zurück zu „CUxD“