LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID control

Hello everyone,

 

This is my first time using the PID toolkit to maintain the pH level of a specific solution and I am attempting to regulate the pump by giving volume flow. I want to control the pump so that the program will open and close the pump as needed to reach the desired set point(Volume flow).  the pump is not variable flow control pump, it either Fully closed or fully open. I made a code but it doesn't work properly. Sometimes it shows an error message. I have attached all files here.

 

Any kind of help would be appreciated.  

 

Thanks in advance

Download All
0 Kudos
Message 1 of 4
(2,633 Views)

So, although I'm not sure what your Arduino code is supposed to do, it seems like your pump is being instead controlled by the DAQ Express node labelled 'DAQ Assistant2'?

 

The first error message you posted (Error message.JPG) is due to the output of the PID subVI being negative and the analog output of that express node being limited to 0-5V. If the output hardware can support a wider range, you can change the settings in the express node. If it does not, you should adjust the PID inputs such that the output cannot be negative. For example, you could set the PID Range control to be min 0, max 5. As a default, the +-100 corresponds to a percentage.

 

As a separate note, I've never seen these formula express nodes before, but they seem very difficult to read. The connector pane is dreadful and you're not even using the error inputs, which would seem to be the express node's main advantage. Please use the primitives instead to make it much clearer - in the second node you're only subtracting 0.2, which can be done with just a single subtract node and a numeric constant, in which case the code is much clearer to read.


GCentral
Message 2 of 4
(2,603 Views)

Dear Mr. Cbutcher,

Thank you for your suggestion. I am not expert in LabView, so the code is a little bit unclear. Actually, I want that the pump will stop automatically after reaching the set point and to reach the set point, it will use PID method. 

 

Would you mark the wrong/unclear points of my code or rearrange the code according to your suggestion, please.

 

TIA....

0 Kudos
Message 3 of 4
(2,559 Views)

My suggestion would be to first test that you can control the pump/value as needed, using for example a boolean control on the front panel.

Once you have a VI that allows you to click the button and the pump turns on, then click again and it turns off, and so on, you have the basis of your setup.

 

Following that, you need to automate your button based on the level of the tank. Since you only have a boolean control, I'm not sure what a PID controller will do for you here. Really, if you want to fill the tank you need to open the value, and when it is dilute enough, you should close it. You can then monitor the pH, and when changes too much, open again.


GCentral
Message 4 of 4
(2,554 Views)