Sign in to follow this  
Followers 0
gromit

PLC5 PID Setup

5 posts in this topic

I'm setting up a PID instruction in the PLC5 PLC which interfaces to a CiTect HMI. Currently there is a control strategy that determines the output to a chemical pump speed controller via a dosage rate strategy. We are going to add a PID strategy that incorporates an input from an analyzer, but also leave in the current dosage rate strategy. Therefore, I have a HMI push button to select between the PID and Dosage strategies. When in PID mode I want the dosage output to track the PID output and vise-versa for bumpless transfer, but I am not having any luck. I am using the PD blocks rather than integer blocks for the PID controller. Please assist.

Share this post


Link to post
Share on other sites
I attached the ladder routine with the PID instruction. Basically, I have an issue when changing between the two control strategies while achieving a bumpless transfer. I have another PID controller in anothe ladder routine that always jumps to 31% when activated in Auto. DK_NACLO.zip DP_DEMIN_PLC_100917.pdf

Share this post


Link to post
Share on other sites
What you have posted looks incomplete to me. It might help if you could post the whole program if you are allow to. A couple of comments on the PID instruction you do show. In the PLC5 world the PID instruction needs to be updated with a timer on the same rung as the PID instruction set to the same rate as the update time configured in the PID setup. In your case 1 sec. So put a self resetting timer upstream of the PID instruction. With out it you can get inconsistent results from the PID. If you want a bumpless transfer when going from auto to manual and back you need to set the "PV Tracking" to "yes" in the PID configure. Not sure about your dosage control, is it an analog or pulse control? If its analog you can write that to the PV's output when its in manual.And the opposite ( to the dosage control output) when the PID is in auto. Edited by Mickey

Share this post


Link to post
Share on other sites
The easiest way to do this is to understand "manual" vs "auto" vs "software manual" modes. Manual mode (.MO) means that there is an external PID controller that the PID loop passes control to. The PV in this mode should read the process variable. The tieback variable in this mode represents a feedback from the external controller's output (CV). You are welcome to use this mode but it is not very easy to use. The .SWM bit controls "software manual". This is a "manual" mode in the truest sense of the word. You put your output command in the .SO (software output) (value is 0-100%...PID scales it for you). If you enable "tracking" then the SP will follow the PV when in software manual mode. Otherwise, it stays locked onto the last set point entered. With both SWM and MO off, you get "auto" mode...PID control. Note that firing the PID loop is a little intimidating. You need to put in the "timing" information (how often you fire it) in the setup and fire it at the rate you inputted. Then you fire off the PID (set the rung conditions to be true) AT THAT RATE. You can fire the PID loop at a variable rate if you have some way of measuring the timing information as well, even every PID "scan". This is one of the toughest parts to understand. Note that if you check your scan rate and multiply by 10, then if your firing rate is slower than this, you can use a "self resetting timer" and you won't get any PID timing jitter problems, assuming your program code does NOT change and cause a timing jitter problem. However, if you fire the PID loop relatively fast, as you commonly do for tighter control loops, the timing jitter problem inherent in "self resetting" timers will become a big issue. You can fix this by either executing the PID loop inside an STI ladder (most common method) or using an "infinite timer" (search on this forum). So in this particular case, I suggest you simply create 3 "modes". Mode 1 is "PID control" (SWM bit = 0). Mode 2 is "manual control" (SWM bit set, input comes from an operator/technician input). Mode 3 is "original mode" where you put the output of your original control scheme (scaled 0-100%) into the .SO input rather than operator input, and .SWM bit is on (and tracking mode too if you don't use it for "manual" control).

Share this post


Link to post
Share on other sites
Thanks for your response Paul. I will digest your comments and figure out how I could incorporate them in my current application. Much appreciated.

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