Sign in to follow this  
Followers 0
Lordzorak

PID auto/manual

4 posts in this topic

My question has to do with the auto/manual bit and how to go about changing CV values. On a SLC 5/03, with the bit cleared, the PID is in auto. It hums right along figuring a CV output. But set the AM bit and you go to manual. My first question is what is the best way to manually change the output? Should I write a % to the CV output in the control block (word 16) or is it better to write to the CV address itself? The second question is: What is the best way to go from auto control to manual control and back again without radical jumps in the system? Specifically when going from manual to auto. I know that once it goes back into auto, it will look at the error and the PID values to determine a CV. But is there a way to make that CV change based on what the manual value was when it was switched back to auto instead of basing it on a value of say zero that may cause a sudden change in the output? With the logic I have now, when switching from auto to manual, things are good. The output is held at what it was in auto and we can then manually change that value. However, if we then go back to auto at some point, the PID does not start out at the value that was in manual and will, in some cases jump the full spectrum and then control itself back to the area where the manual value was. What is the best way to accomplish these transitions with using the previous value as the starting point? Now, I believe that my transitions problem is related to how I did my logic. Specifically, I disabled my PID and used logic to either take the output of the PID or a manually inputted value and write one of those to the output directly. Hopefully there is a way such that when I return to auto, it uses the previous manual setting as its starting point instead of just jumping to. But this whole thought process made me realize that I did not know the best way to handle manual control of a PID. I suspect that I could clean up a lot of junk (along with learning a good lesson) if I can understand the best way to use the PID in manual mode. The application is a fan control. For most of the running time, the PID controls the output. However, at startup and shutdown, specific speeds are preferred. There are also times during normal operation where it could be advantageous to move the PID to manual and set in a specific fan speed. Then when that time frame is over, switch it back to auto. So if someone could give me some advice or direct me to a previous thread that had some good information on this, I would appreciate it. Thanks. Z

Share this post


Link to post
Share on other sites
You write to the "CV" which is user defined. Word 16 is status only ( read only). The the PLC5 PID instruction you could set the Setpoint to track the Process Variable in the manual mode. Nice feature. You can do this with logic when in the manual mode in your SLC5/03. Just move the process variable the the setpoint when in manual, when changing back to auto the transfer is bumpless. You will then have to adjust the setpoint to ??? if desired. Leave the PID instruction enabled. Edited by Mickey

Share this post


Link to post
Share on other sites
First, If you don't have it, download a copy of Publication 1747-RM001-EN-P, SLC-500 Instruction Set. It has much more detail than the online help in RSLogix 500. This is the short version, but the answer to your first question solves your second question. What you're looking for is called bumpless transfer, where the PID controller output does not change when switching between automatic and manual modes. In the SLC PID function, you use the control variable, reading it in Auto and writing to it in Manual. The PID remains enabled at all times, so that in Manual mode, it reverses the calculation to make the integral sum track the PV and CV. When the PID is switched to Auto, the PID initially calculates the same output from the current sum. When you disabled the PID function in Manual, the integral sum did not track and the CV jumped to the last calculated value when switching to Auto. I typically use a separate A/M bit and CV register for the HMI read/write, scaling the PID CV to the HMI CV % in Auto and the revese in Manual. The HMI A/M bit drives the PID A/M bit and may be paralled with other bits that force the PID (but not the HMI) to Manual on stop or other conditions. There may also be other logic to force the PID setpoint and/or CV to certain preset values under specific conditions, such as you're looking for on startup or shutdown. I hope this helps. Enjoy the holiday weekend! Mike

Share this post


Link to post
Share on other sites
Mike: Yes, the information you gave was helpful. I was suspecting that it was something simple and my misguided attempt at auto/manual logic. I have removed the unneeded items and modified my logic. I will not be able to test it until tomorrow or the day after depending on weather. This will let me know if I understand correctly what you said or not. Thanks to both you and Mickey for your replies. Z

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0