From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID in LabVIEW

Solved!
Go to solution

Greetings. I have one question about PID coding in LabVIEW.

 

---- "Can I use 2/3 set point in one PID vi?"

0 Kudos
Message 1 of 26
(4,178 Views)

Greetings. I have one question about PID coding in LabVIEW.

 

---- "Can I use 2/3 set point in one PID vi?"

0 Kudos
Message 2 of 26
(4,175 Views)

Hi Milon,

 

Can I use 2/3 set point in one PID vi?

What is a "2/3" setpoint?

 

Generic answer on your generic question: you can have as many setpoints you like…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 26
(4,171 Views)

Sorry. that is 2 or 3. By the way, in that case, do I need to add separate PID gains?

0 Kudos
Message 4 of 26
(4,168 Views)

Hi Milon,

 

maybe you should describe your problem better…

 

You use/need different PID gains when your system is changing it's parameters with the working point. The PID toolkit brings a function called "PID gain schedule" which allows easier picking of the PID gains. But again: describe your problem better to get more accurate answers!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 26
(4,160 Views)

Hi GerdW KNIGHT,

thanks for your quick reply. I have to control fertilizer (nutrients) level during plant irrigation. I will use 3 different sensors (K ISE, NO3 ISE and Ca ISE sensor) to check these ion level in irrigation water. For managing accurate fertilizer level, I will mix liquid fertilizer/nutrients into the water. I want to use PID controller to maintain a constant fertilizer level. I saw some example video on youtube. but they use one setpoint. I want to control 3 different nutrients at a time in same LabVIEW code. I am using NI-USB 6009 for data acquisition. 

 

Hope, you have understood. Now, my question is, can I add 3 different set point or 3 different PID gains (Kc, Ti, Td) in one PID vi. You already said YES. Now I need to check that.

Message 6 of 26
(4,153 Views)

Hi Milon,

 

so you want to control 3 different fluids/materials using 3 different mixers/pumps and 3 different sensors?

 

Then you should learn about the polymorphism in LabVIEW!

The PID function in LabVIEW is polymorphic and can be used for one control loop as well as multiple control loops…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 26
(4,146 Views)

Hello Mr. GerdW

As I am using NI USB 6009, I can add 2 sensors only. I tried to use cluster option but failed. I have attached my PID code here. Would you modify the code for 2 setpoints and 2 PID gains, please? Thanks in advance. 

 

I also attached a picture. that setting wasn't working. 

Download All
0 Kudos
Message 8 of 26
(4,105 Views)

Hi Milon,

 

use the array type of the "PID Advanced":

check.png

You see all those thicker wires: these are arrays! 😄

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 26
(4,101 Views)

Hi GerdW,

Thanks for your quick response. 1 last question. 

"Do I need to use Arduino circuit (Like UNO/Mega) for this code? I feel easy in NI USB 6009". Above code shows some errors.

0 Kudos
Message 10 of 26
(4,096 Views)