Sie sind auf Seite 1von 2

Here are some tips about PID (FB PID_Compact): 1 General Tips: The instances DB of the PID_Compact are

located in the path Technological Objects (not in Program blocks). 2 If you want that the PID runs in automatic mode without automatic optimization, you need: a. Set the checkbox Use manual PID parameter setting, in the Configuration, tab Advanced settings. b. Set 3 to the variable sRet.i_Mode of the respective instance DB c. Extra tips: a. if you intend to Set the checkbox Use manual PID parameter setting, do it, but after that change the mouse focus before to close the Configuration windows. Else your check will be loose. b. Follow I attached a minimal sample program To work: 1 - Adapt it to your hardware. 2 - Download it 3 - Open the Watch Table PID and go online. Set the alread selectioned values. d. Avoid overrange values to Process Values. Use Limit instruction for float point PV. Take a look at FAQ "How can you prevent your S7-1200 PID Compact controller from going inactive in the case of a PLC power cycle and invalid process values?" (http://support.automation.siemens.com/WW/view/en/46163827) Sometimes, however, it is not possible connect the periphery directly to the PID. For the case of use the variable Input it is also necessary that the incoming values are float point valid values and inside of the input monitoring limits. In the follow posts there is a library with a version of the FAQ decrypted library to be used in this case. 3 Reverse operation: It could be obtained with a check box (Invert PID controller output) or, like S7-200/300/400, with a negative value of Proportional Gain 4 PID goes to inative mode (e.g. after power on). Two possible causes: 4a PV or SP are invalid or out of range: Take a look at the FAQ:"How can you prevent your S7-1200 PID Compact controller from going inactive in the case of a PLC power cycle and invalid process values?" (http://support.automation.siemens.com/WW/view/en/46163827) 4b Monitoring time fault: How can you restart a PID controller stopped by sample time failure or disable the sample time monitoring? See FAQ: http://support.automation.siemens.com/WW/view/en/42321471 5 To access directly to PID parameter look at the instace DB.sRet: P = r_Crtl_Gain I = r_Ctrl_Ti D = r_Ctrl_Td etc. 6 When using PWM control, the PWM cycle is defined as a multiple of the PID runtime cycle. This value is defined in the intern (Instance DB) variable "sRet.r_Ctrl_Cycle" 7 The offitial documentation about the FB1130 (PID Compact) stay on the Online Help of STEP 7 Basic, and on the product manuals (http://support.automation.siemens.com/BR/view/en/40808553pg 172 and http://support.automation.siemens.com/BR/view/e n/36932465 pg 649). Other reference is the the getting start manual of STEP 7 Basichttp://support.automation.siemens.com/BR/view/en/40263542). The chapter 4 has a step by step. Click on the link "info" to get the sample programs. 8 Sample program with simulation: In the Tip https://www.automation.siemens.com/WW/forum/guests/PostShow.aspx?PageIndex=1&PostID=253011&Language=en& onlyInternet=False#253011 it is possible to download a sample program that simulate a field reaction. With this, it is possible to "see"how the PID perform the tunning without field devices associated. 9 Error codes that doesn't are in the online help: If several errors are pending, the values of the error codes are displayed by means of binary addition. The display of error code 0000 0003, for example, indicates that the errors 0000 0001 and 0000 0002 are pending. 10 Reset: If the PID Compact detects some fault in the controlled process (e.g. an invalid process value supplied), at security reasons, it goes to inactive mode. In this state the output of the PID stay not active. To bring back the PID to automatic operating mode it is necessary: 1 Eliminate the fault cause.

2 Make a change of the internal variable sRet.i_Mode from 0 to 3. In the follows posts there is a library that performs an automatic change of sRet.iMode to bring back the PID to the automatic mode as soon as possible. Additionally, the block saves the error code and the last operating mode before the fault. Naturally, a automatic reset of a PID could be dangerous and should be used with knowhow of the application (!!!).

Together with the libary, there is a picture that shows how both block should be interconnected. 11 Operation with standard digital outputs. The TIP Sample program: PID Lean PWM generator for standard IO (https://www.automation.siemens.com/WW/forum/guests/PostShow.aspx?PageIndex=1&PostID=207881&Language=en&onl yInternet=False#top) has a sample program that emulate a PWM with standards timers and could be used with standard outputs (naturally with low speed). 12 Open source PID For the case to adjust the PID to particular cases (for example, execution from OB1), there is a open source PID (that has no relation with this one) in the FAQ PID Lean https://www.automation.siemens.com/WW/forum/guests/PostShow.aspx?PageIndex=1&PostID=223367&Language=en&onl yInternet=False#top

Das könnte Ihnen auch gefallen