Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Installing a PID controller

Hi There,

Posting your code could be a great help.  I do however wonder if you might be better off feeding the values to the PID loop and negating (multiply by -1) the output?  Only a thought.  The osscilation is also possibly a factor of the coefficients that you have chosen for your PID setup, have you played around with the setup values?

I look forward to your answers and code

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 11 of 14
(1,385 Views)

Here is the code. I am still thinking how to map the output to 0-10V valve control signal. 0V referes to fully closed and 10V referes to fully opened position of the valve.

Lalith 

0 Kudos
Message 12 of 14
(1,380 Views)
Hi Lalith,
 
I've taken a look at your code and there doesn't seem to be any problems that I can see with the logic.  If your system is oscillating wildly, you will probably need to adjust the PID gains, especially the I and D components.  Refer to this link for more information:
 
In terms of mapping your output signal from 0 to 10 V, it will involve the math algorithm you have setup based on your inputs to produce your setpoint.  I can't really check that for you as I don't have the same equipment and setup as you do, but it should have something to do with the math in the case structure you have for calculating the PID setpoint.
 
Regards,
Way S.

Message Edited by TheWay on 09-03-2007 10:00 AM

0 Kudos
Message 13 of 14
(1,369 Views)

Thank you very much for the comments. I was able to tune the PID controller and now it is working as I expected. Thanks for the support.

Lalith

0 Kudos
Message 14 of 14
(1,359 Views)