Multiple Input interfering PID controller?

The node-red-contrib-pid appears to only have 1 input, and potentially multiple ouputs. There's an example of an output of a Heater and a Cooler being used to control the input of Temperature.

I'm wondering if anyone has had any success decoupling control loops using this node, and successfully controlling 2 loops of distinct inputs and outputs which interfere with each other.

The loops I'd like to decouple would be of the inputs Temperature and Humidity, with the outputs of an Evaporative Cooler and a Ultrasonic Humidifier..

I haven't quite gotten in there yet and done any research on it, but it'd sure be nice if someone has just done it already :slight_smile:

Thank you for your time.

If you're confused as to what I'm talking about, this resource is fairly comprehensive:

Welcome to the forum @Marth

If you want to control two separate process values you will need two pid nodes.
If the two process are closely linked, so changing the output on one process affects the value on the other, then it can get tricky. Often one can just ignore that and let the pid loops sort it out between themselves.
If that doesn't work, but you have some knowledge of the maths involved in the process then it is often possible to determine two derived values that are more or less independent of each other and control those.

Sorry, I didn't see this post initially, for some reason.
Yes, that is what I am talking about too. You will need to use two PID nodes with the logic around them to derive the independent (or at least less dependent) process variables.

Thanks for the response Colin. Was starting to wonder if anyone would respond! LOL

I feel like I can reduce the interference between the loops..

Frankly, the minor optimization for my system doesn't justify the work.

I'd be trying to convert transfer function matrix functions from matlab to javascript and would probably not be able to use the PID node you developed, unless I'm not seeing something.

If you have an elegant solution that you think would suffice though, let me know! Was hoping someone had kind of done it already. Time to cram a couple single input PIDs together and hope for the best LOL.

EDIT: What happened to your clanlaw blogpost going over the tuning process of the demonstration PID flow you posted? Would love to reference it.

I have done it previously, but every process is different. You have to work out what derived values to control that reduces the linking between the loops.

Do you have a vague idea of the maths relating the process values to the inputs?

PID loop tuning using node-red-contrib-pid in node red

Silly me. That link is dead on this page though: https://flows.nodered.org/flow/42f125b56a00dd5d1433c2f8023263e9

Do you have a vague idea of the maths relating the process values to the inputs?

It's a small space with moderate mixing, and both the ultrasonic humidifier and the evaporative cooler will be pulling in ambient air. They're both going to have different Temp and Humidity with respect to each other daily.

I was thinking I could reference the other process variable after each loop and try to approximate a frequency dependent transfer function that way for each G_P12 and G_P21. I would also need to do the same for G_P11 and G_P22 in order to completely solve the space. I don't believe they would qualify as linear time invariant systems though, which they'd have to be in order to Laplace Transform them so they'd be compatible with the time dependent readings the sensor would be giving... Hopefully I'm wrong about this I really don't know.

I would love to work on it, but my first priority is making sure I can get the PID nodes you've developed working LOL.

Thanks for pointing that out, It has been wrong for ages and no-one noticed, or at least no-one posted about it. Should be fixed now.

On the loop, then if your process allows I would try to tune it by first setting a fixed value on the humidifier output and then get the temperature loop working reasonably well. Then fix the cooler output, enable the humidity loop and tune that. Then try with both and see how it does. Don't try and tune them too tightly initially, so prop bands rather wider than they need for example.

Are you using something like influx and grafana? I find that invaluable for tuning as it lets you look back and see how it performed with various settings. Here, the graphs for that would be useful if you find you do need to do something clever with the loops, as you will be able to see how, for example, the humidity changed as the cooler output varied.

Very great advice.

That was the thought for determining the transfer functions retroactively (using some table and a function approximation per iteration of the loop). I wasn't sure how I was going to do it--was just trying to see if it was possible first and I think it is. It's just WAY too much work for me right now..

I'm gonna keep it as simple as can be and just cram two PIDs together for now lol.

Thanks for the thoughts and engaging the idea a bit. It's something I'll be willing to put more time into once the system is up and running and I can justify putzing about.

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