LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing PID control loop between flow meter and pump

Hello,

 

I'm attempting to code a PID loop in order to control a process. Essentially, we are using a flow meter to measure the rate at which our process impurities are leaving the solution, and we want to match that flow rate to a pump that will be pumping water back in.

 

Can a PID control loop be used to control this? All the examples I've seen are of things like proportioning valves where the transmitter is also the process parameter adjuster, not like my situation where the transmitter is a seperate entity for the process parameter adjuster. Additionally, we wouldn't want to set an in-stone set point, rather have the set point be whatever the flow meter is reading. Is this possible?

 

Thank you!

 

Will

0 Kudos
Message 1 of 12
(10,235 Views)

Hi Will,

 

yes.

And yes to your second question, too.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(10,219 Views)

GerdW,

 

Thank you for the response. So for instance in the screenshot below, would the analog input that comes from the flowmeter be wired to the "SP" (setpoint) node, and then would the "Manipulated Variable" output be wired to the pump with which the flow meter is matching?Tank Level P&ID Simulator.JPG

0 Kudos
Message 3 of 12
(10,189 Views)

What are you actually controlling on the pump? If you're controlling flow rate, then there's no need for a PID loop. You just send the pump a new setpoint to match the flow meter reading. On the other hand, if you're controlling some other pump parameter - such as the pump speed - then yes, you could use a PID loop, but you'd need an independent measurement of the flow rate out of the pump to match it to the flow rate from your flowmeter.

0 Kudos
Message 4 of 12
(10,168 Views)

Nathand,

 

We are attempting to control pump speed (RPM). Basically, we have a pump and then directly after we have a flow meter. The flow meter sends the 4-20mA signal back to LabVIEW which is scaled to a flow rate. We want to use this flow rate to have the pump adjust either up or down until the flow rate requirement is met. Can you give me any tips on the best way to accomplish this?

0 Kudos
Message 5 of 12
(10,117 Views)

Hi willlago,

 

actual flowrate = pv, desired flowrate = sp, pump speed = PID output.

All you need to know (or derive from experiment) are the PID gains…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(10,108 Views)

@willlago wrote:

We want to use this flow rate to have the pump adjust either up or down until the flow rate requirement is met. Can you give me any tips on the best way to accomplish this?


There's still some part of your system I don't understand. How will you know that you've met the flow rate requirement? Are you measuring the pump RPM and there's a fixed relationship between the pump speed and the flow rate? Do you have two flow meters, one out of the pump and a second one measuring the impurity flow rate? There's no problem using the reading from the impurity flowmeter as the setpoint to the pump PID, but you also need to determine what you will use as the process variable for the PID. A diagram of your system, showing where your sensors are, might help.

0 Kudos
Message 7 of 12
(10,102 Views)

My apologies for the confusion, I now realize I was asking on a thread for something that is no longer an issue (impurity out > water in). Below is a diagram of the system.System Diagram.JPG

Let me back up and start from the beginning. With the PID loop we want to implement, we want to control P-101 based on the reading of FT-101. 4-20mA signaling does not control the flow rate of the pump, rather the RPM (0-600RPM for this pump). I want to take the scaled reading from FT-101 in L/min and then use that in a PID loop to reach a setpoint for P-101 (say 5L/min). Basically, since the pump input (RPM) and the flow transmitter output (L/min) are not the same, I'm wondering if LabVIEW will know to adjust the RPM of the pump based on a given flow rate.

 

Please let me know if you need more clarification.

0 Kudos
Message 8 of 12
(10,094 Views)

willlago wrote:

Basically, since the pump input (RPM) and the flow transmitter output (L/min) are not the same, I'm wondering if LabVIEW will know to adjust the RPM of the pump based on a given flow rate.


That difference in units is a fundamental part of PID control; it's not an issue of LabVIEW "knowing." If the output and input are the same units, you set the value directly and you don't need PID.

 

You can think of proportional gain as a ratio of output units to input units. It says that for a certain amount of error (in the process variable units) you want a particular response (in the ouput units). For example, if your process variable and setpoint are in L/min, and your output is in RPM, and your proportional gain is 50, then for an error of 1 L/min you'll get an output of 50 RPM. Of course you'll probably have an integral component (and possibly derivative too) and those also have real, physical meanings, but the proportional gain is responsible for converting between units (at least in the "academic" form of PID, which I find the easiest to understand).

0 Kudos
Message 9 of 12
(10,084 Views)

Nathand,

 

This makes quite a bit of sense. I'm going to attempt to code it with PV being the FT-0201 output, and SP being my desired pump flow rate and see how it works.

 

Thank you very much!

0 Kudos
Message 10 of 12
(10,079 Views)