5/18/2011 7:38 AM | |
Posts: 53 Rating: (0) |
Hi, Attachmentpid.pdf (1342 Downloads) |
5/19/2011 12:26 AM | |
Posts: 53 Rating: (0) |
Hi Aret, Thanks for your reply. Find attached the pdf of my code for the particular FC. We are controlling a steamcontrol valve to achieve the desired cooktemperature. The temperature setpoint for the is set from the HMI (db95.dbd74). network no 5 is to ensure the transition from Auto to manual is bumpless but not sure why it's not bumpless from manual to auto. please advise. Thanks, MS AttachmentFC52.pdf (1175 Downloads) |
5/19/2011 12:55 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi You have option of using Modular PID Control as a software package from SIEMENS.I think 3 function of this package would be helpful: 2.1.20 PID: PID Algorithm parameter SMOO_CHG ,smooth change over from the manual mode to the automatic mode. 2.1.23 ROC_LIM: Rate of Change Limiter Ramp functions are used when the process must not be subjected to a step change at the input. For example when the set point or gain of PID algorithm change suddenly(Jump in these crucial parameters). 2.1.13 LMNGEN_C: Output Continuous PID Controlle parameter LMNRC_ON ,manipulated value rate of change on,ensures bumpless switchover in manipulated variable. regards |
Last edited by: hdhosseini at: 6/1/2012 2:51 PM |
|
5/20/2011 5:02 AM | |
Joined: 7/2/2008 Last visit: 4/5/2024 Posts: 928 Rating: (305) |
Hello MS10, 1st make sure that auto mode resets manual bit and manual mode resets automatic bit. 2nd make sure that db102.dbw4 is the right word for valve position. If I may suggest, Try making it easy for yourself and use only one bit for automatic and manual and also use the output parameter LMN IF "DB_PID".COOK_TEMP_PID.Manual_Mode = 0 Movethe output parameter LMN to "DB_PID".COOK_TEMP_PID.Manual_CV Also as explained earlier by ARET, in manual mode it's better to transfer the process value to the setpoint So, IF "DB_PID".COOK_TEMP_PID.Manual_Mode = 1 Move the the output parameterPV to "DB_PID".COOK_TEMP_PID.Setpoint If you still face problems then It will be better if you upload your programhere somembers can check it for you. Best regards. H-H AttachmentFC52 with comments.pdf (833 Downloads) |
5/20/2011 10:26 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi See the attachment Attachmentrate_limiter.zip (1927 Downloads) |
Last edited by: hdhosseini at: 10/29/2011 4:23 PM |
|
5/21/2011 4:21 PM | |
Joined: 7/2/2008 Last visit: 4/5/2024 Posts: 928 Rating: (305) |
Hello MS10, I've simulated your software and it worked for me. In automatic mode your manipulated value from PID is returned back to manual value. Nothing is wrong. Please tell me how you test it and why you think it's not working. Best regards. H-H |
5/23/2011 5:47 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Dear member
Using the function posted before may help you by changing steps to Ramps in CV.If you have such a jump, I think you may have high Proportional part in PID algorithm. To check the value of each section you can check LMNP, LMNI and LMND in FB41.If you have momentary high LMNP , so reduce gain to have lower LMNP. To obtain optimum P,I and D parameters for the algorithm, you can use PID SELF TUNER of SIEMENS.
If you scale your PV before applying to the PID controller and PVPER_ON reset to false ,you should have no problem.To be sure of result,you can check ER parameter to be near zero for steady state. regards |
This contribution was helpful to1 thankful Users |
5/23/2011 8:45 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
The function FB67 needs an input which likely to experience an STEP, for example in case of mode transition sudden jump in LMN may happen. So, LMN output of PID controller should be fed into the input parameter of FB67.I have checked your codes,so some modification can make the function applicable for your requirement. Also check this link for an similar example of working with peripheral inputs/outputs. On the FB58 itself in OB35 can we assign just a part of inputs and outputs (for example PV_PER and LMN_PER) and leave the others without any assignment?regards |
5/24/2011 11:25 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Dear member Please check the attachment, this is the modified version of your PID controller.I insert the FB67, rate limiter function in the codes to avoid experincing sudden jumps in the process , this for sure make any transition in your controller bumpless.About the analog output ,the problem solved. For analog input,it is working fine for process variable in range of 0 to 100 (see the equation mentioned in the on line help of FB41).So, if the range of PV differes you should assign a value instead of default value 1 for PV_FAC. OUT_CPR_IN= PV_PER * (100 / 27648) OUT_PV_NORM=(OUT_CPR_IN*PV_FAC)+PV_OFF I think the equations are clear.But , if your PV is from 0 to 320 centrigrade, you should select PV_FAC=3.2 Hope to be helpful hdhosseini AttachmentPID_TEST.zip (498 Downloads) |
5/24/2011 12:45 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi again Please check the attachment for a file which illustrates the functionality of rate limiter.In this test ,LMN of FB41 is manually changed and STEP with different values fed to FB67.You can see the ramp in analog output. regards Attachmentzip.zip (399 Downloads) |
5/26/2011 9:28 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Tunning a controller ensures us that the response of the algorithm to the SETPOINT change or process's disturbance has in range over(under)shoot, rise time and settling time.Sudden Jump in output of a PID controller is due to mode change (auto to manual or vice versa) or gain change in runtime. The topic is discussed in "Controlling with SIMATIC" published by SIEMENS . The reason explained and remedies provided(section 5.2 of book).
This is explained in the following topic by dchartier and me. Please note that , You may select either of SP>PV or PV>SP. For example, in a tank which start from 0 to setpoint to be filled is like SP>PV while colling a process from ambient down to a setpoint is like PV>SP. If you select the action type wrongly , the controller may not function properly.If you have a process in which SP>PV so error is positive and PID functions properly.But if you wrongly chose PV>SP, you have always negative value and and PID may generates 0 in LMN. Determine reverse or direct action of PIDhope to be helpful hdhosseini |
5/28/2011 11:35 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Error in PID algorith is calculated by SP-PV.So, if you havePV>SP ,error generated by algorithm is always negative and it may not have proper result. You should select the negative Gain to be multiplied by negative error and lead to a positive value feed to algorithm.
The speed of response or let say rise time is one of the characters of |
5/28/2011 12:40 PM | |
Posts: 53 Rating: (0) |
Hi Hdhosseini, |
5/28/2011 9:02 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Please check the attachment,Sorry for drawing my own curve for step response of a process( I am afraid of copyright infringement). As shown in the most important part SP>PV and the control valve is opening. This is the time in whicj the overshoothappens PV>SP, so this is the nature of PID controller to make the error zero.The negative error will force the control valve to close.
I will check you codes again,please provide trends to judge better.Did you modify the codes or they are finalized? regards hdhosseini |
5/29/2011 7:33 AM | |
Posts: 53 Rating: (0) |
Please advise how to do offline trending/simulation.. |
5/29/2011 7:54 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi Please check the attachment,I think the trend roughly illustrates your problem.When you change from manual to auto, and the set less tha PV,algorithm close the valve immidately because of negative error.I am sure that algorithm will settle the process value to the setpoint as illustrated in the attachment.This is natue of PID controller.Please prepare some trends of your process.By the way Your running the PID algorithm with a very small gain. For getting optimum value for P,I and D you can use PID SELF TUNER of SIEMENS.Check here. Regards |
5/29/2011 9:25 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
You are truly welcome,Also check: PID CONT_C FB41Regards |
Last edited by: hdhosseini at: 5/29/2011 9:26 AM |
|
5/30/2011 2:23 AM | |
Posts: 53 Rating: (0) |
Hi Hdhosseini, I've increased the gain and also and Ti and it doesnt seem to help with my PID block.. the LM just goes up to the maximum value or jump to the minimum value. I have just noticed another thing.. When SP>PV.. and i put it in AUTO.. the LMN will increase steadily.. then I put it in MANUAL (LMN is the same as the last AUTO value)... but when I put it back to AUTO.. the LMN value seems to always jump back to either theLMN_P or the sInvAlt.. I have tried this with different setpoint and see the same pattern in all cases.. let's say in AUTO the LMN increase up to 100 (max.) then I change it to MANUAL (LMN stays at 100).. then I change it back to AUTO.----> the LMN always jumps back to the LMN_P or sInvAlt then start increasing from there again.. Please help.. I started to get quite desperate here cos I've only got today to fix this problem.. This may have some relation with the other error that I have(LMN goes to 0 when PV>SP).. Thanks... Please see the attached screenshot of the DB.. note that the value of the LMN on the screenshot is not exactly = to LMN_P as it depends on when I press the 'screenshot' button on my keyboard.. but I am sure it always jump back to there values.. Attachmentpid screenshot.pdf (358 Downloads) |
5/30/2011 6:33 AM | |
Posts: 53 Rating: (0) |
Hi, I have checked the other PID loop that I have on the code and they are all behaving similarly... Once we move from MAN back to AUTO ---> LMN always move to LMN_P (and i found out that LMN_P = error * gain) what is this LMN_P?? Attached is the latest code.. it has not changed since the weekend.. I know now why my gain value is very small... is it because my PV and SP is set to 0-27648? thanks. MS AttachmentPid_test (2).zip (371 Downloads) |
5/30/2011 9:54 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi I followed these steps and check your codes with PLCSIM: 1-PV and LMN and Setpoint are disconnected from your logic, PV and SP in range 0 to 100 2-PSEL and I SEL are always true,They are not selected from HMI 3-LMN is fed to FB100, process simulator and the output of the function fed to PID algorithm as PV. The result is, there is no jump when you swith from manual to auto.I guess the problem occured because of one of BOLD item determined.We do not know any thing about the logic interfaceto the HMI.But I am sure the controller works fine , if there is no wrong interface to it. I will upload the program I worked with. regards Attachmentpudd.zip (532 Downloads) |
Last edited by: hdhosseini at: 5/30/2011 11:24 AM |
|
5/30/2011 9:55 AM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
This is the snapshots of the checked result regards AttachmentVID.zip (470 Downloads) |
Last edited by: hdhosseini at: 10/1/2018 4:16:41 PM |
|
6/1/2011 12:15 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359) |
Hi This is why we are here, Reading problems and find solution for them.Thanks to give us the chance to undrestand another Pitfall of PID controllers. regards |
Last edited by: hdhosseini at: 6/1/2011 12:22 PM |
|
6/10/2011 1:13 AM | |
Posts: 53 Rating: (0) |
Thank you! |
This contribution was helpful to1 thankful Users |
2/23/2012 5:07 PM | |
Joined: 9/16/2008 Last visit: 4/2/2024 Posts: 56 Rating: (0) |
Hi, I'm facing a problem for a PID controller. Its for a Crown COntrol in 20 Hi Mill where 1 micron accuracy is required. Here I'm attaching my source code along with the IBA file. The problem is when I'm going from a higher value to a very low value there is undershooting which is not good. I try to control but its not happening. Can any one suggest me how to tune it for getting better result. Regards, AttachmentCrowndata.zip (406 Downloads) |
2/23/2012 7:48 PM | |
Joined: 1/28/2009 Last visit: 4/1/2024 Posts: 6836 Rating: (1359)
|
Dear bigbang, It is much better to upload snapshots of results instead of IBA file.Note, sudden change in "Setpoint" may cause the "Undershoot" you mentioned.Using "ROCLIM-Rate of change limiter" is recomended because all Steps in Setpoint are converted to ramps with a selectable increasing and decreasing rate.I introduced a rough version of a rate limiter in this thread, you can try that. Another tip, check LMN_P,LMN_I and LMN_D individually.If any irregular response, try to rectify parameter corresponds to that component. For tuning option, check the following: PID SELF TUNER
Best regards, Hamid Hosseini |
Last edited by: hdhosseini at: 5/7/2013 10:36 AM//typo |
|
Follow us on