8/25/2008 7:30 PM | |
Joined: 10/31/2005 Last visit: 3/7/2023 Posts: 293 Rating:
|
Hello, I have noticed that there are a lot of questions in which people ask about examples with PID blocks and even process simulation. Attached, you'll find small but effective PLC program that represents real time process simulator. It can be used to simulate FOPDT (First Order Plus Dead Time) and SOPDT (Second Order Plus Dead Time) processes. FOPDT and SOPDT can be used to approximately describes most technological processes. More information about FOPDT can be found on www.controlguru.com. (look at heat exchanger example) SOPDT is very similar. FOPDT can be described with the following transfer function: exp(-TD*s) *K/(Ts+1), where TD is dead time. SOPDT uses representantion with damping and natural frequency. There are plenty materials on the Internet. This program is my small contribution and I'm sure many will find it usefull. You can practice PID controller tunning (changing parameters or even enabling and disabling different forms P, PI or PID). I used PLCSIM to simulate control loop . For example, if you want to use FOPDT simulation (after download and Run CPU) turn on M3.0 and M3.2 . Then in Setpoint field (MD20) enter desired value and observe how process output is changing (MD20). For SOPDT process value is MD30, but beside M3.1 and M3.3 you need to set MD25 as output from PID controler (since MD25 is input to SOPDT process). For start, I recommend you to use FOPDT (default), set M3.0 and M3.2, then enter real number in Setpoint field. If you use PI controller (default), after some time PV (MD20) must reach desired value. If you disable integral component (I_SEL switch to Always OFF), then PV will not reach Setpoint and there will be always offset error. You can also change parameters of process and parameters of controller. I suggest you to use reasonable dead time and sample time values because I used static array with maximum assumed size for simulating dead time. I hope you'll be able to open this project (File->Retrieve) because of known issue of STEP 7 with Regional Settings. I'm also willing to share SCL source code, if someone is interesting. This simulator is written by me with initial help from Peter Nachtwey, president of Delta Computer Systems. I hope you'll find this useful. All comments are useful. Best regards AttachmentSimulato.zip (1695 Downloads) |
Last edited by: Pandiani at: 5/20/2009 6:51 PMMinor changes Last edited by: Pandiani at: 9/4/2008 5:07 PM |
|
This contribution was helpful to
11 thankful Users |
8/25/2008 8:08 PM | |
Joined: 7/16/2006 Last visit: 12/20/2022 Posts: 1502 Rating:
|
I will test. Thanks for the Programm / Simulation. I world back an feedback. |
Karl |
|
9/2/2008 7:02 PM | |
Joined: 10/31/2005 Last visit: 3/7/2023 Posts: 293 Rating:
|
And here are source files, since you show interest. Best regards, Pandiani AttachmentSource.zip (1087 Downloads) |
Last edited by: Pandiani at: 5/20/2009 6:47 PM |
|
This contribution was helpful to
1 thankful Users |
10/29/2011 6:09 PM | |
Joined: 10/10/2010 Last visit: 11/23/2022 Posts: 296 Rating:
|
thank you very much ! it's a fantastic project !
|
7/20/2012 12:21 PM | |
Posts: 36 Rating:
|
hiii Pandiani why when i using first order, if the SP is exceed 100 (e.g. 120), the LMN is always 100? thanks.. i also modified your program as follow in attachement AttachmentFirza__7.zip (446 Downloads) |
7/20/2012 1:00 PM | |
Joined: 1/28/2009 Last visit: 2/21/2023 Posts: 6794 Rating:
|
Hello , PID controller (FB41) works based on error signal in automatic mode .As we Know For most cases(Except cases like THIS): error:= Setpoint - process value Monitor error signal and portions of LMN_P, LMN_I and LMN_I in outcome LMN signal.Setpoint is the constant part of equation.You should check what is wrong with process value. Best regards Hamid Hosseini |
7/20/2012 5:08 PM | |
Posts: 36 Rating:
|
aha, its already fixed but why in Fopdt, PV_IN cannot exceed 200? |
Follow us on