12-05-2012 03:15 PM
Hello,
I have a high pressure fuel pump, connected to a fuel pressure regulator, which is hooked up to LabView. Based on the fuel pressure setpoint chosen, LabView sends out a signal to increase or decrease the regulator control voltage.
The system was working fine until a few days ago, when the system crashed, and LabView 7, the device drivers etc. were re-installed. The .VI in question, is Simple PID.vi
For safety reasons, the fuel pressure is set to -200 bar when not in use. And we move in steps of say, 100-200 bar to our final setpoint (for e.g, 600 bar). PROBLEM - When I change the setpoint value from -200 to 0, the regulator control voltage immediately shoots to its maximum of 10 V (which is equivalent to 1200 bar setpoint).
I do not know why this is happening. Any suggestions on how to fix this? Is it possible for this to be related to the device gain (SCXI 1100)? [Right now the gain in MAX is 1, however, I don't know what the earleir value might have been before the system crashed].
Please help me out, Thanks a lot.
12-05-2012 03:42 PM
PID systems need to be tuned. There's tons of help on the web for how to do it but it still remains a bit of a black art since every system is different. Here's a good start from NI:
http://www.ni.com/white-paper/3782/en
12-05-2012 03:44 PM
Did you have a backup of the code prior to the crash, or you rewrote what you thought was the correct code after you reinstalled everything?
Are you sure that you need the PID VI? If 10V is equivalent to 1200bar setpoint, it sounds like the regulator does all the control for you, in which case PID is not necessary - you just need to send the voltage that corresponds to the fuel pressure you want. PID is for the situations where your code is acting as the regulator, and it sounds like that's the the case here.
If you're certain that you need the PID, could you elaborate more on your system and perhaps attach your code? How did you determine the PID gains (and are you sure they're the same as they were before the crash)? How are you reading and scaling the fuel pressure (process variable)?
12-05-2012 03:52 PM
Thanks very much for your quick replies.
I have a SCXI 1000 chassis with a SCXI 1100 module connected to a 1303 board. This is connected to the PC through a PCI 16E-4 DAQ card. A pressure transducer is connected to Labview which displays the current fuel pressure, and the regulator control is connected to the above chassis, and controlled using the Simple PID.vi
I believe having PID is convenient, and thats how the code has been operated for many years. I am simply using the backup code, and have not made any changes whatsoever.
Please find my code attached. Thanks a lot.
12-05-2012 03:58 PM
nithyan2 wrote:
I believe having PID is convenient, and thats how the code has been operated for many years. I am simply using the backup code, and have not made any changes whatsoever.
I'd say it has been MANY years - LabVIEW 2009 tells me that your code is in version 5.0 and can't open it because it's too old. Before the crash, were you using LabVIEW 5, or LabVIEW 7? Did you install the same version of LabVIEW, and the same version of the operating system, the drivers, and the PID toolkit (if there even was such a thing at that time)? Is it possible your backup code was out of date (from an earlier version of LabVIEW)?
12-05-2012 04:03 PM
The original code was written in LabView 6.1, and running on Windows 2000.
I am running the code in LabView 7, on Windows XP 32-bit. I installed the device drivers, and Trad-DAQ 7.4.4.
The other parts of the code seem to be working, however, the fuel pressure PID part is giving me problems.
I dont think there is any PID toolkit missing, as Simpel PID.vi is normally available in the LabView palette.
Please let me know your thoughts. Thanks.
12-05-2012 04:40 PM
Again, I believe the code you uploaded is in LabVIEW 5 (according to LabVIEW 2009 when I try to open it). So I'm puzzled that you say the original code is in LabVIEW 6.1. Are you sure your backup was the working version?
Were there any settings - such as PID gains - that were saved in a settings file you might have lost when the system crashed?
12-05-2012 04:46 PM
Hi nathand,
That is surprising. I always thought it was LabView 6.1. Anyway, other portions of the code seem to be running fine in labView 7. I have not found any settings saved anywhere.
So what are my options? How should I proceed? I am planning to just go ahead and try to tune it myself.
If you have any suggestions, please let me know. Thanks.
12-05-2012 05:40 PM
Tuning:
Look in your code to find what the current Kc, Ti and Td values are. Are they defined, or just set to default values ?
Set Td = 0, so no derivative action
Set Ti = 10000 (or some big number), so very very slow integral action
Run with just proportional only (Kc = current value).
If the PID output keeps saturating high, reduce Kc by factor of 10 (5, 0.5, 0.05, etc) and repeat.
Hopefully you'll find something that starts to show some sort of control - but may not attain SP. You can then start increasing Kc a bit / reducing Ti to improve response - for a pressure regulator values of Ti = 0.5-10 (seconds) might suffice.
Once you have it crudely working, you'll then need to decide if performance is good enough - if not then you may need to do tuning a bit more analytical.
If the above doesn't give anything useful then there could be issues with other settings - e.g. range limits on outputs which need to match the actuator range to prevent wind-up in PID controller, or scaling settings for converting your measurements from volts/current into engineering units.
Hope it is simple for you.
12-05-2012 08:44 PM - edited 12-05-2012 08:44 PM
You're running a different version of the operating system, a different version of LabVIEW, and a different version of the DAQ drivers that you were previously. That's a lot of changes, and while ideally none of them should have affected the operation of your VI, it's possible that one of them has. In addition, a 2.7mb VI from LabVIEW 5.0 is huge, which suggests to me that it's not well organized and is likely difficult to debug and maintain.
You can try retuning the PID as AndyClegg suggests, and maybe that will be enough. Otherwise, I can't tell you where to start, especially without seeing your code. If you save the VI in LabVIEW 7 and upload that, I think I'll be able to open it in LabVIEW 2009, although I'm not certain.