egraham Posted March 15, 2008 Report Share Posted March 15, 2008 The LabVIEW example "Manual-Automatic Control" uses the PID Advanced function to control a simulated process variable. It allows the user to switch between manual and automatic control of the manipulated variable. When in manual mode, the horizontal slider representing the MV is a control. When in automatic mode the controller takes over and using a local variable the horizontal slider represents the output of the PID controller. I'm trying to do the exact same thing in my VI, but when I enter manual mode the control of the manipulated variable is very erratic. It's almost like the local variable is trying to lock it in place and keep me from moving it. I can get it to work if I disconnect the process variable input to the PID function, but this shouldn't be necessary and obviously something else is wrong that I'm overlooking. The input goes through a mean pt-by-pt function to clean the signal up a bit, but whether or not I remove this doesn't change anything. As far as I can tell, my VI is identical to the LabVIEW example, but it is not behaving the same way. I uploaded a picture and the VI. If anyone could point out what I'm not seeing I would be much obliged. Thanks! Quote Link to comment
Yair Posted March 15, 2008 Report Share Posted March 15, 2008 QUOTE (egraham @ Mar 14 2008, 07:37 AM) It's almost like the local variable is trying to lock it in place and keep me from moving it. I don't have access to a computer with the PID toolkit at the moment, but from your picture, what causes this seems to be simple - you write a value to a local variable of your control. That essentially changes the control's value at the same time you change it, thereby causing the effect you're seeing. The solution to this would be to wrap the local in a case structure and only write it when in automatic mode. Quote Link to comment
egraham Posted March 15, 2008 Author Report Share Posted March 15, 2008 Yes, it would appear that way, but look at the attached picture from the LV example VI. It is wired in exactly the same way and it works very well like this. So there is something else I'm not seeing. It wouldn't be the first time... Quote Link to comment
ned Posted March 15, 2008 Report Share Posted March 15, 2008 QUOTE (egraham @ Mar 14 2008, 08:53 AM) Yes, it would appear that way, but look at the attached picture from the LV example VI. It is wired in exactly the same way and it works very well like this. So there is something else I'm not seeing.It wouldn't be the first time... Perhaps this is just a timing issue; are you running your loop much faster than the NI example? The NI example should exhibit the same behavior that you're seeing, but if the amount of time spent doing the PID calculation is a tiny fraction of the overall loop time, you won't notice the effect. Quote Link to comment
Yair Posted March 16, 2008 Report Share Posted March 16, 2008 Personally, I would expect to see the same behavior in the NI example, because if it changes the value of your control twice a second, it should steal control unless the change is so minimal from the current value of the control that you don't notice it. Without looking at the actual code I can't tell for sure, but this seems to be a bug in the example. It wouldn't be the first time. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.