New Automation: PID Controller

yes you’right. I just want to use the output of the pid directly for the zwave eurotronic dimmer.
if this will not work, ok virtual items are also OK.

But my problem actually is, that I can not see any output of the pid on the logs.
I can see changing of debug items for p, I, d and error.
but no sent command to my dimmer item.
that’s confusing

hmm. the pid controller, or the rule that uses the pid controller has an item to send the command to.
in my case I want to use the eurotronic dimmer item as the item to sent to.
the setpoint comes from the user

Can you post the code of the rule, the PID controller is configured in? (Click on the Code tab in the rule settings)

Here it is:

configuration: {}
triggers:
  - id: 58d52f8e-62b7-416b-9f23-c5f957f8f573
    label: PID Controller Trigger
    configuration:
      input: TestPid_ActTemp
      setpoint: TestPid_Setpoint
      iInspector: TestPid_I
      kp: 10
      eInspector: TestPid_E
      pInspector: TestPid_P
      kd: 0.8
      kdTimeConstant: 1
      dInspector: TestPid_D
      ki: 0.1
      loopTime: 60000
    type: pidcontroller.trigger
conditions: []
actions:
  - inputs: {}
    id: "1"
    configuration:
      itemName: Testht_Dimmer
    type: core.ItemCommandAction

and that my desired setup

According to the name of your output Item, I assume it’s of type Dimmer. Try to make it Number as @Dominik_Jeziorski already pointed out.

ok,. if I create a new item, just a virtual item as number,
it works.
so I need to create an additional rule that does the transfer.

one question again.
is there a way to disable the pod controller or does this make sense.
in my rules for example if I’m leaving home i switch off my. heating regulator.
but the pid controller is still running, producing output in the logs. so. is there a way to disable it until I’m coming back home?

Best way is to lower the setpoint to the desired value if you’re not at home. I don’t see any reason for disabling or pausing the controller when you leave as physics will continue.

1 Like

ok in generally you’re right.
but in this case the pid controller still produces logs.
I just want to prevent filling my Logs with all this changes because they make no sense if I’m not at home.

and even if I lower the temperature, the pid will not reach the target, because the actuator is off…

Ok, but if there is no way, that I will leave it as it is now.
thanks

With all honesty I don’t really understand why you have problem with that.

Usually logs will rotate so if you will set it to like static 10MB size + rotate of 5 files - you will not use more space than that.

Second thought is that typically you should forget about it and don’t look inside at all unless issue will occur. In my case I barely look inside and when I do - I’ll would search for something specific.

~60 lines of logs per hour shouldn’t be that much and if you are affraid about wear of SD card then solution is to create in memory drive that will host data that can vanish (RAM disk).

That’s my opinion - I work at company where we generate up to 10TB of logs daily out of few hundred different apps so few lines here doesn’t bother me at all.

I don’t really have any thought how to disable those completely. There is no off option in controller.

I do not really have a problem.
I just saw that logs were generated without having any real usefull information for me,
because the actuator is off.

I’m not afraid because of the sd card or something.
Also I’m able to filter the logs.

I just want to find out if there is a way to disable this.
now I have my answer and ignore the logs.

Thanks again

I’m having some difficulty using the Derivative Gain Parameter.
When I set it to other than 0, and the error (eInspector) is positive, the output increases by kp*error + kd*error.
(for simplicity, ki = 0)

Isn’t this wrong? Shouldn’t the output be kp*error - kd*error.
I believe that is the only way that the derivative can slow down the change.
Or am I misunderstanding something?

Interesting question! At first glance I’d say you’re right, but in other implementations on the internet, there aren’t negative signs either.

@DavidR @fwolter

I haven’t used the kd parameter in my automations.However, the Derivative action should be opposing the change as David suggests.

Did you try setting kd parameter to a negative value? I would expect that to have the desired effect.

Unfortunately the UI does not allow negative values for kd.

@DavidR

I am able to enter a negative kd if I edit it in the ‘Code’ panel:

image

I must admit I struggle to understand the formal representations of PID’s on the web so I cannot give a concrete example, but as I said, the derivative should slow the change, and I’m afraid it doesn’t :smiling_face_with_tear:

Allowing kd to be negative would give a chance to play.
Can you think of an easy way I could do that?

Edit. Just seen the above. I’ll try.

It works in the Code page unless you then try to modify anything in the Design page. It then complains about the negative kd when it validates the input.

Yes changing the setting in the Code page produces the correct behaviour. Thanks @Morgano

I’m controlling a gas central heating boiler so response times are very slow. Tuning the PID values is taking days. Getting there now though.