The Turkey Slayer

Using a PID to control a digital output

6 posts in this topic

Hey guys, here's my situation. I'm rebuilding a panel at work and we're eliminating a couple of temperature controllers in favor of using the PID functionality of the Micrologix 1100 (the panel is in a food plant and is sprayed down daily so we lose these door-mounted controllers a lot). The tunnel is cooled using liquid CO2 and a series of valves. The valves open to cool the tunnel and close when the temperature is met. Since the temperature has to remain as constant as possible, I feel I should use a PID loop instead of a simple high-low limit scheme. My question is what would be the best way to use a PID loop to control a digital output? I'm really inexperienced with PIDs and so far I've only run into controlling an analog output with an analog input.

Share this post


Link to post
Share on other sites
Is each PID controlling only a single valve or multiple valves? If its a single valve then its pretty easy to set up a time proportioning algorithm. Create a timer that has the desired time control period - I recommend that you use whatever the current controllers has. Then use SCP to scale the PID output to the same range as the time period, and then compare that scaled value to the timer ACC to see if you should turn the output on or off. For example, lets say we choose a ten second time control period with a timer using the .001 second time base and a preset of 10000. The PID output CV is at 9830 counts (out of 16383), or 60%. Scale using SCP PID_CV 0 16383 0 10000 N10:0. This will put 600 in N10:0 Now use comparisons to determine if the timer ACC is less than 600 and turn on the valve. LES T4:0.ACC N10:0 OTE VALVE. So the valve turns on for 60% of the time, and off for 40% of the time.

Share this post


Link to post
Share on other sites
Thanks! I did some digging and that's exactly what I came up with, too. Each controller is controlling two valves but they are run in parallel, so either both valves are open or both are closed.

Share this post


Link to post
Share on other sites
You can use timers if you like but you may also want to have a look at the two 20 kHz high-speed PTO/PWM outputs (on MLX1100 controllers with DC outputs). Also a caution, make sure that the rate you're cycling the valves is within what the valve is meant to do or things might become ill behaved (wear out valves, valves not fully opening or closing etc).

Share this post


Link to post
Share on other sites

Do you have an example of the ladder Tconnolly?

 

kind regards Glenn

 

Share this post


Link to post
Share on other sites

Time Proportioning Outputs

have this running in several SLC500s.

I figure the 1100 PID can't be that different.

 

See chapter 9 Proportional Integral Derivative Instruction

Time Proportioning Outputs section starts bottom of page 9-30

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1747-rm001_-en-p.pdf

 

 

SLC500 IntructionSet Chapter 9ssss.pdf

Edited by jimtech67

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