LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Controller not working properly

Hello,

 

I'm attempting to use the Labview PID VI to control the humidity of a system. Basically I have an airflow with high humidity and using an Mass flow controller I'm adding another flow of low-humidty air to get the desired % of humidity. I measure humidity and temperature of the flow with a sensor soon after adding the the second flow.

 

My problem is that I can't manage to tune the PID to avoid oscillation of the humidty. I've tried using the Ziegler-nicole method and I either get oscillation or I get a fairly stable value that is nowhere near the desired value.

 

The input from the sensor is 0-5V and the output to the MFC is 0-1V (the output is reversed since an increase in this flow gives a lower humidity).

 

Attached is the program I've been using so far, any ideas at all on if this might have something to do with my programming or if it's the physical system would be very much appreciated.

 

Thank you. 

0 Kudos
Message 1 of 9
(5,612 Views)

Hi,

 

I could not able to open your VI as i am currently working with Labview 8.6. It would be great if you can send the VI in LabVIEW 8.6 or screen shot of the block diagram.

 

As far as your issue is concern, it is very tricky to control humidity. As you know from the definition, humidity is tightly couple with the temperature. 

 

Let me understand your issue further to suggest some solution

 

Are you trying to control absolute humidity or relative humidity?

Is your temperature parameter controlled as well or not?

What is your system open loop response time and PID control loop rate?

 

Thanks,

Vijay Jayabalan.

0 Kudos
Message 2 of 9
(5,597 Views)

Attached is the file saved as 8.6-version.

 

It is the relative humidity I'm trying to control, sorry for not mentioning that earlier. The temperature is just measured and not used for the controlling with the labview program. However, the temperatures of the flows is very stable, with the second flow being about one degree warmer.

 

Since I'm not currently at my system I can't check the exact response time but for the two different setups I've tried it's been around 1 second and 2 seconds respectively.

 

I've tried using Dt's for the PID ranging from 1 to 3 second, with little change noticable.

 

I can get back with more exact response times if necessary later today.

 

Thank you for your help.

0 Kudos
Message 3 of 9
(5,576 Views)

Ok, so a small update is that I've managed to tune fairly well now by using some guesstimation 🙂

 

Still, It would be very nice if you could just look at the program real quick and see if I've done something incorrectly, seeing as I havn't dealt with labview in quite some time.

 

Thank you.

0 Kudos
Message 4 of 9
(5,567 Views)

Hi Lever,

 

I did look at your code. You implementation is correct except the "Wait Untill Next ms Multiple" timer. I find this function "Wait Untill Next ms Multiple" not required and may introduce the problem with respect to the Loop rate. 

 

By rule of thumb PID loop rate should be minimum 4times faster that that of response time. Say the system response time is 1sec, than the loop rate must be faster than 1/4sec = 250ms... In that sense setting the sampling rate to 10,000 samples/sec and reading at 1000 makes the entier loop rate to 100ms, this is fair loop rate with the response time in 1 or 2 second system. 

 

By having the "Wait Untill Next ms Multiple" function in the loop may cause the loop rate to be wobbling between 100ms to 150ms based on the resources use in your computer. Because, under windows environment user interface thread occupies the highest priority in execution. 

 

May be you should use the actual time it took to execute rather than we supply some value to the PID VI. I quickly modified your code for the above said implementation. 

 

If the temperature is kept within 1degree Celsius, it shouldn't be a matter at all. Other than this now comes the important part, PID tuning. Please let me know the procedure adopted to tune it. 

 

Regards,

Vijay Jayabalan. 

 

Download All
Message 5 of 9
(5,551 Views)

Thank you very much for your help Vijay, I will think a bit about how to do the timing and take a look at your modified code.

 

As for the tuning, I've been trying to use the Ziegler-nicole method but I've been having a hard time finding the Kp where it starts to oscillate since it's all been a bit blurry. At the moment I copied some parameters from another similar looking system and they are actually working quite well, however I'm going to try some more tuning methods.

 

My main objective is to get as small steady state error and variations as possible. Overshoot and settling time is not really a concern at the moment since it will run at a preset RH for a long time.

 

Thank you again for your help.

0 Kudos
Message 6 of 9
(5,532 Views)

One thing to think about here. I looked up the Ziegler–Nichols tuning method and it clearly indicates that it is a very aggressive tuning method. You may want to reconsider the tuning method.

 

Z–N yields an aggressive gain and overshoot[2] – some applications wish to instead minimize or eliminate overshoot, and for these Z–N is inappropriate.

Tim
GHSP
0 Kudos
Message 7 of 9
(5,518 Views)

Yes, I am aware of that the method is quite agressive, however as I said, I'm not really concerned with overshooting. The upside of the ZN-method is that it's very good at quickly handling small temporary variations in the flows.

 

But anyway, since the ZN doesn't really yield me any good values atm, I'm going with a open loop step test method.

0 Kudos
Message 8 of 9
(5,512 Views)

Ok, final update; Using the open loop step test I've succesfully tuned it and it's working sufficiently now.

 

Thanks for the help given!

Message 9 of 9
(5,497 Views)