LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID loop question. For a pressure vessel.

Hi All,

I have a question about PID loops.

 

I am trying to control the pressure of a vessel. I have setup two PID loops.

The first PID loop uses the pressurization rate as the process value, and the second pid loop uses the desired pressure setpoint as the process value.

The first PID loop runs until I am within 0.1 psi of the set point and the second pid loop runs inside the 0.1 deadband.

 

My problem is I don't get a smooth transition between the two pid loops. The graph has a little jitter and the 2nd pid loop is unaware of the rate that came from the 1st loop.

 

My pid loops are inside a state machine, and I think the loops should be outside the state machine.

 

Is there a better approach to doing my controls?

0 Kudos
Message 1 of 8
(3,017 Views)

Maybe you can run both PID controls in parallel loops outside your state machine and based on the state select which setpoint should be used to control the pressure.

Initially you can ignore the output of the second PID control, until the pressure reaches 0.1 psi. When this condition is satisfied, you can switch to the second PID control and ignore the first one.

Message 2 of 8
(2,998 Views)

Hi Hyperbaric,

 

My problem is I don't get a smooth transition between the two pid loops.

Well, when both PIDs use different PVs it will be hard to get a smooth transition: the first PID tries to meet your dp/dt setpoint, while the second one will control pressure by changing dp/dt.

You did not mention which kind of PID control VI you're using. The ones coming from NI PID toolkit allows setting a manual control value and works bumpless. So you can (maybe) use your pressurization rate as "manual control" input to your 2nd PID…

 

The graph has a little jitter and the 2nd pid loop is unaware of the rate that came from the 1st loop.

How is a "graph" and "jitter" included in your PID loops?

The unawareness can be changed as mentioned above…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 8
(2,991 Views)

Thanks. I was thinking the same as you.

0 Kudos
Message 4 of 8
(2,983 Views)

Hi Gerd,

I am using PID.vi from the pid toolkit by NI.

 

So you can (maybe) use your pressurization rate as "manual control" input to your 2nd PID…

Did you mean the output of the 1st PID loop goes into the "Manual Control" input of the 2nd PID loop (when using PID advanced.VI)? I am not sure what manual control does.

 

How is a "graph" and "jitter" included in your PID loops?

The graph is basically a pressure vs time profile. You can see the graph and notice the jitters when the pressure changes from loop 1 to loop 2.

 

The ones coming from NI PID toolkit allows setting a manual control value and works bumpless

Are you saying that I should programmatically change the setpoint and process variable for the 1st PID loop (when reaching the 0.1 psi deadband) and ignore the 2nd PID loop?

 

Thanks for the help and suggestions.

 

0 Kudos
Message 5 of 8
(2,976 Views)

Hi Hyperbaric,

 

the "manual control" input is explained in the help for the PID functions…

 

You can see the graph and notice the jitters when the pressure changes from loop 1 to loop 2.

I cannot see any graph nor do I notice jitter. Where is this to be seen?

 

Are you saying that I should programmatically change the setpoint and process variable for the 1st PID loop (when reaching the 0.1 psi deadband) and ignore the 2nd PID loop?

No, I do say you could (maybe) use the output of the 1st PID as manual control for the 2nd to use it's bumpless mode switch feature…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,934 Views)

Hi GerdW,

Here's the graph.

0 Kudos
Message 7 of 8
(2,896 Views)

Hi Hyperbaric,

 

I see a graph with a plot consisting of a ramp and a (more or less) flat line.

The "jitter" (or better: variations in the flat line) are less than the width of the line, so that shouldn't be a big problem…

 

You didn't mention any specs for your PID control loops: what is the expected accuracy? How fast do you want to set pressure? How stable should that pressure be? How many overshoots are tolerated? How much overshoot is tolerated? Do you know your system very well? With all it's time constants you need to know? How did you tune those PID parameters?

So many questions for such a flat line…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(2,867 Views)