2/13/2021 11:30 AM  
Posts: 4 Rating: (0) 
Hello everyone ! I am trying to implementing PI controller in TIA to control valve position with analog values 0  10 V .I tried to realize the control with PID_Compact and the system works perfect, but my idea was to design PI control without PID_Compact. First tried only with Proportional control but the system is unstable and the error is about 2% then I decided to include Integral ingredient to minimize the error to minimum. I create Cyclic interrupt OB and there I take samples for the measured error through every 500ms. PI algorithm is in FB which is outside Cyclic interrupt OB. The process is stable but , the response time is big , and every time is different and I think there is a problem in logic. I read in forum that is matters between cycle time and sample time , but I don't understand, could you explain me ? Should the ' PI' FB block be called in Cyclic interrupt . 
2/13/2021 12:11 PM  
Joined: 9/27/2006 Last visit: 4/22/2024 Posts: 12257 Rating: (2664) 
Hello germanov; The first part of any PID implementation is the "sampleandhold" 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/sampletimeisafundamentaldesignandtuningspecification/ D.C. I was looking for an old (Nov. 1996!) application tip from Siemens illustrating the implementation of a PID controller with a S7300, 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 (163 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