09-18-2019 04:58 AM
I am designing a LabVIEW software for PID control algorithm. In the manual mode operation, due to the criticality of the system, the valve % should not suddenly jump to the new valve % value in one go, instead it should go at a rate of 1%/second. For example, if the current valve % is 30% and we want to set it to 50% then it must open the valve in steps of 1, that is, 31, 32, 33 and so on till 50%. How can I achieve this without using a 'for' loop? I am using different subVIs (e.g. to read/write P,I,D values, to read/write Setpoint etc) in the main VI program. Read/Write valve% value is also one of the subVIs. The attached images show the basic idea, but I am not able to do it properly (without using For loop). Can anyone help me out?
09-18-2019 05:56 AM
09-18-2019 06:12 AM - edited 09-18-2019 06:13 AM
The vi in the images shown should work - but I don't know the context of how you're calling them. If you would share your code you would get a lot better quality help.
While I do not think a FOR loop is required for your application, nor even how a FOR loop would be beneficial (again, I've not seen your code so I don't know), I do wonder why the arbitrary requirement to do this without a FOR loop was implemented. It's usually better to use the tools that work than to add some arbitrary requirement.
09-18-2019 06:29 AM
@rajesh111 wrote:
In the manual mode operation, due to the criticality of the system, the valve % should not suddenly jump to the new valve % value in one go, instead it should go at a rate of 1%/second. For example,
Isn't the point of the PID to limit the ramp rate, overshoot, etc? Design your PID correctly and this should not be an issue.
09-18-2019 06:32 AM
Anything you do with a For Loop you can do with a While Loop. Both iterate, using an "index" labeled "i" in the lower left corner that increments by 1. The While Loop stops when the Stop indicator is set to True, the For Loop stops on various "counting" conditions (depending on whether N is wired or not, or whether inputs are brought in through an Indexing Tunnel). There are a few "specializations" that you can mimic with additional code:
Bob Schor
09-18-2019 07:10 AM
In the PID pallette there's also a rate limiter that will achieve this.
/Y
09-18-2019 07:49 AM
@crossrulz wrote:
@rajesh111 wrote:
In the manual mode operation, due to the criticality of the system, the valve % should not suddenly jump to the new valve % value in one go, instead it should go at a rate of 1%/second. For example,
Isn't the point of the PID to limit the ramp rate, overshoot, etc? Design your PID correctly and this should not be an issue.
Reading between the lines...
"PID Advanced.vi" has a manual input that allows us to set the output manually and will allow for bump-less transition to PID control.
Ben