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.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Installing a PID controller

I want to control a position of a valve according to the pressure. Simply, I want to operate the valve in a closed loop. Do I always need to use Lab view real time or can I do this in windows environment?
0 Kudos
Message 1 of 14
(5,922 Views)
Hi there,
 
It is quite common to have a PID control system using non RT systems. Here is a link to some more information (using NI M Series devices) :
 
Let me know if you have any questions.
 
Way S.
NI UK Applications Engineer
0 Kudos
Message 2 of 14
(5,909 Views)

Hi,

Many thanks for the guidance. The white papers helped me a lot to understand my requirement better. However, still I am not sure whether I should go for LabVIEW window based DAQ or LabVIEW Real-Time DAQ. Any comparision between two approaches? I have found reliability is one issue but is it only the reason? 

0 Kudos
Message 3 of 14
(5,901 Views)
Hi there,
 
Reliability is one of the important reasons to go for RT instead of a non-RT approach.  Another reason is to be able to program accurate timing loops, for example, if you programmed a task in a while loop to occur every milisecond in a non-RT OS (eg. Windows), the task might not really execute at that rate (especially if repeated over long periods of time) because a non-RT OS is processing many other different tasks in the background at the same time.  You can refer to this tutorial for more in-depth information on the benefits of RT:
 
On the other hand, running your code on a Windows OS might be reliable and accurate enough for your application.  It will also be simpler since you can develop and run your code on the same computer and OS. 
 
Way S.
 

Message Edited by TheWay on 06-27-2007 10:50 AM

0 Kudos
Message 4 of 14
(5,886 Views)

Hi,

Thanks. I got you.

0 Kudos
Message 5 of 14
(5,811 Views)

How can I read few analog inputs simultaneously? I want to use one AI to implement my PID controller and other AI to log data. How can I do that? Is there any particular example that you would recommend me to go through?

Thank you in advance.

 

0 Kudos
Message 6 of 14
(5,206 Views)
Hi,
 
All you have to do is add another channel to your acquisition task setup.  Both channels will have to acquire at the same rate. Depending on the DAQ device you are using, you might not be able to get the maximum rate of the device and there might be a small interchannel delay between channels.  Getting an S Series DAQ board will address those issues.  Refer to this KB for more information on simultaneous sampling:
 
Regards,
 
Way S.
0 Kudos
Message 7 of 14
(5,166 Views)
Here is the design that I developed. Could you please check whether I have made any basic errors in the design? I am new to LV and want to know whether my approach is correct. Thank you very much in advance.
0 Kudos
Message 8 of 14
(5,143 Views)
Hi Lalith,

The functionality of the code seems ok. There are a few layout issues that could be improved (such as wires going back on themselves and code being a bit spread out) but nothing major. If you search for LabVIEW Style Checklist in the LabVIEW help it will give you guidelines on laying out your block diagram well.

Regards

Jon B
Applications Engineer
NIUK & Ireland
0 Kudos
Message 9 of 14
(5,121 Views)

Thanks for comments. In fact I tried my code in the real test. The results are not satisfactory. The system oscillates. I am planning to tune the controller. Still do not know how to do that. Before that, I want one clarification to make to make sure the logic of my code is correct. As you know I am tring to maintain a certain preassure profile. So I have got the set preessure and the real pressure. Those will be input into the PID block and the output drives the valve. The valve is fully closed at 0V and fully opened at 10V. So I set 0 as the minimum and 10 as the maximum of my output from the PID block. If the real pressure is less that the set pressure, then I want to close the valve. This will increase the pressure in the system. If the real pressure is higher than the set pressure then it needs to open the valve to decrease the pressure in the system. Therefore I am multiplying both the set pressure and the real pressure by -1 before feeding into the PID block. I wonder whether this would cause the system to oscillate. Simply my error=real pressure-set pressure. I can post my code here if you are not clear of waht I am saying. Thanks in advance.

Lalith

0 Kudos
Message 10 of 14
(4,806 Views)