2/13/2021 12:11 PM | |
Joined: 9/27/2006 Last visit: 3/20/2025 Posts: 12344 Rating:
|
Hello germanov; The first part of any PID implementation is the "sample-and-hold" procedure, where the samples of the process variable are captured at precise, known intervals. This prevents deviations of the subsequent calculations and removes instability in the control algorithm due to calculations. With Siemens PLCs the best way to maintain a strict and predictable cycle for capture and calculations is to place them inside a cyclic OB, such as OB 35, which will run at very precise intervals. It is recommended to run your PID function in OB 35. The Siemens PIDs allow for a Cycle parameter that can be different than the timing of the cyclic OB it is placed in, but must be a multiple of the cycle value of the calling OB, to maintain calculations in sync with OB 35 calls. If OB 35 runs every 100 ms, the PID Cycle pareter could be 100 ms, 200 ms 500 ms, 1 sec... depending on the process time; a temperature control does not require as fast a cycle than a flow or level application, for example. Hope this helps, Daniel Chartier Edit: a lot of what I learned about PID implementation comes from the site Controlguru, which has provided guidance on aspects of practical PID controls that have been very important in some of my work. I suggest you look at this particular article, then at the Table of Contents, to see if they have anything you might find interesting in your project. https://controlguru.com/sample-time-is-a-fundamental-design-and-tuning-specification/ D.C. I was looking for an old (Nov. 1996!) application tip from Siemens illustrating the implementation of a PID controller with a S7-300, in LAD and STL, thinking it might help in this project. At least the structure and comments might provide hints for your own development. Retraced it this morning, you will find it attached. D.C. Attachmentpidtip.pdf (299 Downloads) |
Last edited by: dchartier at: 02/13/2021 14:06:58Last edited by: dchartier at: 02/13/2021 14:48:02 |
|
Follow us on