LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Software PID loops

I am using LV7.1 and in an application need to ramp up / down the ( 0-10V )command to a Variable Frequency Drive to set the operating speed. The drive is in open loop and to get a reasonable lock on set speed I am trying to implement a  software PID loop as I do not have the PID tool kit. ( and I think for this simple application it may not be needed also ?)
 
The drive will need to run at 1500 rpm for 20 secs then ramp up to 2000 rpm by 23rd second and likewise follow a set pattern of speeds. As can be seen the rates are not very fast.
 
I did a search in  the forum and came with a PID vi ( I have enclsoed it ). Will this be adequate for my job or anything better is available ?
 
I did search the Examples in LV 7.1 and came up with almost 6 types PID codes. But surprisingly they just had a "P" term but were  being called PID !
 
Thanks 
 
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 13
(3,956 Views)

Hi Raghunathan,

Can you please repost the VI saved for some higher version so that I can open it in 8.5.1?

It is in a too low version to be opened in 8.5.1. Smiley Sad

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 13
(3,946 Views)
I have attached the VI as saved in LV 8.0.
 
Please revert with your views. Thanks.
 
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 13
(3,940 Views)
Here it's in 8.5
0 Kudos
Message 4 of 13
(3,935 Views)

Hi Raghunathan,

I looked over the example you provided and as you suggest it is a simple PID control loop. As a result, if the system you are trying to control is simple (as it sounds) the VI should work to control it as long as you stay within the limits of your PC . Since the PID loop is in software, running on a Windows PC, it will suffer from a slow response time (Windows can only be reliable to a ~10mS minimum period of iteration for the loop). You will also need to manually tune the gains for your PID. If you do have some control theory knowledge this example should work just fine, if not I would recommend the PID Toolkit which helps you to build your PID loop, including tuning. I hope this helps to direct you on the right path.

Cheers,

Jonah
Applications Engineer
National Instruments

Jonah Paul
Marketing Manager, NI Software
0 Kudos
Message 5 of 13
(3,898 Views)
Hi Jonah,
 
Yeah I understand.
 
That simple PID formula node may be able to address my needs right now. Let me try it out and revert.
 
Regards
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 13
(3,882 Views)

Hi Jonah,

Before I bring  in the DAS hardware in picture, I was trying to figure out the PID loop with a simple controls for Set value and Process Variables.

By and large its fine and well controlled. But when I try to run the PID_Demo.VI with the set point at "5" and Process variable at "0", then I find that the output suddenly jumps to a large value like 3 or 4 and then ramps up to saturate. How to avoid this initial jump ?

Thanks.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 7 of 13
(3,812 Views)

Hi Raghunathan,

I explored your attached PID_Demo.VI; however, I found that it was unstable for every instance of your Set Point and Process variable. In every case the output saturates to either the upper or lower bound. It appears that your tuning values are incorrect because of this saturation. Please let me know if you are seeing the same characteristics.

Thanks.

Cheers,

Jonah
Applications Engineer
National Instruments

Jonah Paul
Marketing Manager, NI Software
0 Kudos
Message 8 of 13
(3,761 Views)

Hi Jonah,

Try it out this way :

Set the Set point at 5.

Set the PV also around 5 .

Start the VI and now as the output reaches 5 you can tweak the PV knob and manage to maintain output at around the 5 volt level.

I have tried the above for other values like 2, 9 etc The key is to keep adjusting the PV and NOT allow the output to saturate.

Please revert if the above does not happen.

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 9 of 13
(3,739 Views)

Raghunathan,

Based on your previous post, I was able to get the output to settle at the desired set point. However this method requires the user to dynamically change the Process Variable and therefore does not have the characteristics of a closed loop PID system. A usual closed loop control system is able to reach the user set point without user interaction. Do you want the user to dynamically change the Process Variable?

Cheers,

Jonah
Applications Engineer
National Instruments

Jonah Paul
Marketing Manager, NI Software
0 Kudos
Message 10 of 13
(3,723 Views)