Pid control - rs logix500

I'm confident that you did a much better job than RA's efforts.
What efforts did Rockwell make? There should be no problem simulating a PID and the system.


Surely it can't be difficult to write an emulator for a Windows PC that emulates a PLC ? And marketing an emulator that does not emulate 100% is... well, just wrong !
I would write the emulator on the PC but put it in the firmware in the PLC. This is what we have done with out motion controllers. It is possible that the PID in the PLC generates a control output that is used by a program in on the PC to simulate a system. This should be very flexible but the speed or update time would be limited by the communication rate.



Yes of course I understand that speed of execution is going to be a factor, you will not match the scan time of a dedicated PLC, but at least emulate the instructions available, with a caveat that PID terms cannot be relied on. Having said that, they shouldn't be a million miles away, since RA themselves produced SoftLogix to run under Windows.
This shouldn't be a problem.




There will always be some things an emulator cannot do, but what is must do is emulate all instructions, even if it cannot do some as well as it should be able to ....
This isn't true but it takes a lot more work to emulate more than a PID. Things like sequencing take much more effort but it pays off when you an simulate systems before you go into the field to install you code on the real system.




I gave up on RA emulation way back when I discovered that parameter passing to subroutines was handled in the exact REVERSE ORDER to what a PLC did. This is NOT emulation, in any shape or form. Our company and client standards relied upon the PLC order of parameter passing, so we were left high and dry.
Sad. Simulating a system and PID is easy for me. I have decades of experience do this.


Simulating something like a lumber sorter is much more difficult but that is exactly what I did way back in the early 1980s.


This is all piddly stuff compared to simulating aircraft or space craft but think about the difference in the cost of the simulators.






Way back
 
You guys keep forgetting there is the Hotrod.zip file in the downloads/misc section where I wrote a simulator to simulate Ron Beauforts hotrod students trainers. The ladder is for the SLC500 and ML1500.




The OP's problem is that they do not have the PID instruction in the PLC they are using.
 
Here is a simple PID algorithm to try if you cannot simulate it using the built in function

Create a self resetting timer with an iteration time in ms
NOT Timer.DN JC end
error = desired_value – actual_value //sub the actual from the desired value
integral = integral_last + error * iteration_time
derivative = (error – error_last) / iteration_time
output = KP*error + KI*integral + KD*derivative // this is the PID output
error_last = error //Update the last error
integral_last = integral // update the last integral

End
Not tried this recently it is from memory and you would have to convert it into SLC to try.
KP is proportional element
KI is the integral element
KD is the derivative element
The time element would be in 10ms time base i.e. 100ms = 10
The maths could be enabled with the timer.DN bit as jumping is not available in some PLC's
All the variables (KP, KI, KD Error_Last, Integral_Last, Derivative_Last) would be float variables.
 
I coded a PID in ladder for MicroLogix 1100, which does not have a PID instruction; the .RSS file, which may work for SLC, is here:


https://github.com/drbitboy/pressure_control_via_fan_velocity/tree/master/src/MicroLogix1100


It has an auto/manual bit, and uses the Rockwell dependent model. I think it even has bumpless transfer, but don't hold me to that.


That Github project also has a fan process simulator and HMI coded using Visual Basic and AdvancedHMI.
 
I'm pretty sure that the Micrologix 1100 does indeed have a PID instruction available ...

possibly you were thinking of the Micrologix 1000 system? ...
 
I'm pretty sure that the Micrologix 1100 does indeed have a PID instruction available ...

possibly you were thinking of the Micrologix 1000 system? ...




Whoops, my mistake. I wonder why I did that then.


[Update: I think I wanted a bumpless mode switch]




Anyway, thanks, Ron!
 
Last edited:
Whoops, my mistake. I wonder why I did that then.



Anyway, thanks, Ron!

It's still useful if you want to incorporate it into the RSLogix 500 Emulate file. You could even use debug files in such a way that it masks the existence of the external code to fill in the hole in the Emulator and still write logic that can be downloaded into a real PLC and still be expected to behave similarly.


I haven't use the debug files feature much, but some of my 1st experience with it is recorded here:
http://www.plctalk.net/qanda/showthread.php?t=45379
 
Thank you for reiterating what was stated a dozen posts ago.
Then you should have showed us a dozen posts ago.
I have provided many examples of PID code on this forum but they get lost when they are no longer on the front page.
No one searches.


I don't have RS500 on my computer anymore.


Some of the MicroLogix don;t have floating point. That makes it more of a challenge to write correctly with ladder instructions.
 
Then you should have showed us a dozen posts ago.

I didn't show one because,

  1. as I stated, it appears the OP is interested in getting experience working with an actual RSLogix PID instruction,
  2. been there, done that (first time was nearly 4 decades ago).


I have provided ... PID code on this forum


As have I. Not as many examples as PeterN, to be sure, but been there done that.
 
Last edited:

Similar Topics

I have S7 1512C controler for controlling 48 PID temperature loop, the output is PWM. Please I need the best, most efficient way to write the...
Replies
13
Views
591
Hi all, I'm having trouble solving a problem I've been working on for several months, and thought you might like a stab at it. The machine runs...
Replies
22
Views
926
How can I connect PID Output to a valve. In ladder logic program is there any logic do I want to add between valve and PID? PV=SP What will be the...
Replies
7
Views
409
I am setting up control for Hypochlorite dosing. The easy part is the dosing calculation for flow pacing but I would also like to setup trimming...
Replies
8
Views
942
Hey guys! I'm a newbie in the control area, so I'm gonna drop some thoughts here... We want to control the opening of big silos (about 1900...
Replies
6
Views
1,485
Back
Top Bottom