Jump to content

PID advanced manual mode


Recommended Posts

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!

Link to comment

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.

Link to comment

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...

Link to comment

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.

Link to comment

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.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.