03-16-2022 02:20 PM
Hi,
I've only started working with labview this year and I'm really struggling to write a cascade control loop to control both flow rate and pressure together. I have written a loop to control flow rate and pressure separately, and one to also control them manually, but when I try to write the loop I'm going wrong somewhere... or in multiple places.
If anyone can offer advice or guidance, I would greatly appreciate it! I've attached the cascade attempt, and the other two control loops if that helps.
Many thanks
03-16-2022 02:56 PM - edited 03-16-2022 03:04 PM
Hi jk,
@jk1274 wrote:
I've only started working with labview this year and I'm really struggling to write a cascade control loop to control both flow rate and pressure together. I have written a loop to control flow rate and pressure separately, and one to also control them manually, but when I try to write the loop I'm going wrong somewhere... or in multiple places.
If anyone can offer advice or guidance, I would greatly appreciate it! I've attached the cascade attempt, and the other two control loops if that helps.
Why don't you cleanup that code? It really would help to understand the code easier:
03-16-2022 03:21 PM
Hi GerdW,
These are good points - I was trying to follow the structure of a simple cascade loop that one might write on paper rather than in a DAQ labview script and I think it's gone very wrong... I've attached an old version of the script that I wrote without doing this. But does it still make sense to put the output of the pressure PID into the setpoint of the flow PID? This is what I've seen others cascade loops do... but I don't quite understand it.
No, but the calculated PID gains for pressure don't seem to work (used both reaction curve method & oscillation method). When I used the gains for flow, they just happened to also work for pressure
0.1 indicates a nonlinear process, 1 indicates a linear process.
These three points were requested / done previously by my boss (my dissertation is in conjunction with my work) but are they not necessary / helpful?
This is the only way I knew how to do it... I didn't know how to use the math function you're talking about.
I've never heard of this, but I'm looking it up now. Would you suggest I use this for this application?
I can't express how thankful I am for your response - it's been more helpful than my supervisor's comments for this entire project.
Best,
jk1274
03-16-2022 03:27 PM
Attaching the updated labview files as i think they didn't attach again.
03-16-2022 03:29 PM - edited 03-16-2022 03:33 PM
Hi jk,
@jk1274 wrote:
I'm really struggling to write a cascade control loop to control both flow rate and pressure together. I have written a loop to control flow rate and pressure separately, and one to also control them manually, but when I try to write the loop I'm going wrong somewhere... or in multiple places.
Can you describe/picture that cascade control approach?
You want to control a pressure AND a flow rate by the very same actuator? How should that work?
(I also had testbenches with combined pressure and flow control, but usually I had two actuators to manipulate them (mostly) independently from each other…)
@jk1274 wrote:
- Why do you use a 500ms wait function when you could easily determine the loop iteration rate by requesting a fixed number of samples from DAQmxRead!?
- Why do you fiddle with buffer size at DAQmxTiming in "continuous" sampling mode? Did you read the help for that function?
- Do you really need a 4kS/s samplerate for determining a DC offset? Why that DC offset and not just a simple mean function?
These three points were requested / done previously by my boss (my dissertation is in conjunction with my work) but are they not necessary / helpful?
03-16-2022 03:46 PM
Can you describe/picture that cascade control approach?
You want to control a pressure AND a flow rate by the very same actuator? How should that work?
(I also had testbenches with combined pressure and flow control, but usually I had two actuators to manipulate them (mostly) independently from each other…)
I will update these in the system based on your feedback! I paid little attention to these as it was just asked of by my boss, but if they are unnecessary, then that's understandable. The flow rate change based on the valve position is very fast but you're right in that samples may not need to be read at 4kHz.
Best,
jk1274