5/26/2011 9:28 PM | |
Joined: 1/28/2009 Last visit: 9/15/2025 Posts: 6875 Rating:
|
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: 9/15/2025 Posts: 6875 Rating:
|
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:
|
Hi Hdhosseini, |
5/28/2011 9:02 PM | |
Joined: 1/28/2009 Last visit: 9/15/2025 Posts: 6875 Rating:
|
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:
|
Please advise how to do offline trending/simulation.. |
5/29/2011 7:54 AM | |
Joined: 1/28/2009 Last visit: 9/15/2025 Posts: 6875 Rating:
|
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: 9/15/2025 Posts: 6875 Rating:
|
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:
|
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 (578 Downloads) |
5/30/2011 6:33 AM | |
Posts: 53 Rating:
|
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 (565 Downloads) |
Follow us on