12-08-2012 03:13 AM
Hi Guys,
I went through a bunch of PID tuning tutorials, and worked on the code for quite some time. However, I still haven't had much success.
First of all, the SImple PID.vi has all defualt values to begin with. Secondly, after reading many tutorials, I am really confused how these constants like Kc, Ki, Kd, Pc, Pi, Pd, relate to the actual values of P, I and D in the vi.
I tried the manual tuning method (setting I, D = 0 to begin with), Ziegler-Nichols, and the method andyclegg suggested (Setting I to 10000 and D = 0). I get a lot of variations as expected when using only a P value. And I have covered a whole bunch of values from 0.01 to like, 30 in many steps, but I am not able to get any proper stable variations. It still has super-high jumps to the maximum value in between. Adding any values of I and D, just makes it extremely random with huge jumps.
Please give me any suggestions you might have. I am at my wit's end here. Kindly help me out. Thanks.
12-08-2012 05:31 PM
I think we first need to determine which PID function you are using. The one included in the PID toolkit is called PID.vi (at least in recent versions). Older versions of NI-DAQ ("Traditional" DAQ) included a Simple PID VI in one of the examples. I suspect that's what you're using. If you open your PID VI and it has a sequence structure in it, it's the one from the old NI-DAQ example. You could also determine that by checking the path where that VI is located.
If that's the VI you're using, it doesn't support all the features of the PID algorithm from the PID toolkit, and it might have its inputs structured differently. I haven't had an installation of NI-DAQ in years, so I can't check how that VI works. Save it in the most recent version of LabVIEW that you have available and post it here, maybe I'll be able to open it and take a look. It's quite possible that you should start by setting the I value to 0 instead of a large value (actually, that would be the right way to start with the PID toolkit version too).
12-09-2012 04:00 AM
Hello,
The VI I am using is Simple PID.vi from Control.lllb. I have attached the VIs I use saved in labView 7.
Optical Diata 13 LII - This the main VI which we use, and this is the VI which has P,I,D settings on the top of the front panel, and the process variable and current status of the PID setpoint at the bottom right.
Lion Rail pressure - This is the other VI which is connected in some way to the above VI (I don't know how). The PID options here are not changed. This VI is used only as a large display for the setpoint and the process variable of the PID control.
However, what's really strange is that both these VIs show different values (PID curves) when I change the setpoint or P,I,D values.
Simple PID.vi - This is the PID vi used.
Please take a look at these, and let me know any suggestions you have. If you could figure out how the 2 VIs work with each other, that would be very helpful. Right now, one VI does not function properly without the other being open as well (They are on two different computers right next to each other, one with LabView 7, WinXP, new drivers & the other with LabView 6.1, Win2000).
By using P = 1, I = 0.02, D = 0.001, I have got the system to work crudely. The pressure reading seems kind of okay (but lot of variations), but the regulator voltage is jumping up and down like crazy. Also, as mentioned earlier, although both VIs are connected to the same hardware, they seem to show different values.
Any help is greatly appreciated. Thanks for your support.
12-09-2012 12:49 PM
That is, in fact, the PID VI from the DAQ example. The P, I, and D values are unrelated and the I value is gain (not time), unlike the version from the PID toolkit. I have no idea what you mean by "PID curves" - that's not a standard technical term. I do have to wonder why you have two VIs running on different computers that both claim to do fuel rail PID control and that have different scaling for the input (see the formula nodes) - do you have two separate DAQ systems, one for each computer?
Unfortunately, that VI looks exactly like I'd expect for a 2.5mb VI (for those reading along, see image below, missing VIs are NI-DAQ functions), and you'd have to pay me to try to understand what's doing. Five levels deep of nested sequence structures does not make for good LabVIEW code.
12-09-2012 04:40 PM
Nathand has kindly identified what PID block it is you have, and you have tuning values that are working - but not very well, but which you are wanting to try to restore to where they were previously.
Have you seen plots of pressure regulation and corresponding voltage from before, and how do they compare to the ones now ? If it is just a tuning / controller setup issue then showing us plots of target pressure, actual pressure and voltage might help. But then again if you don't know what these looked like before, then it could have been working badly before - perhaps with feedback action correcting for some code problems.
First task is to decide if your code is working properly.