7/3/2013 9:42 PM | |
Joined: 1/28/2009 Last visit: 2/21/2023 Posts: 6794 Rating:
|
Hello friends, Campaign time and storm of new ideas and some in field of regulation / process automation.This "TIP" is not intended for a practical solution.I always recommend using products in range of SIMATIC products for a trouble free result.But, this is just a demonstration and describing a problem and suggestion by a user from STEP 7(TIA Portal )conference.As far as discussed before, there is no deadband in PID Compact version I have checked yet .Member asked to create a new block and impose clipping property of "deadband " to PV.I just tried that with 2 FB41 (because of simplicity) and the result was satisfactory: 1-Implementation of normal deadband with fixed width (D_BAND.pdf ) and test (snapshot#1): [code]FUNCTION_BLOCK FB110 TITLE = 'fix interval deadband' // // Block Comment... // VERSION: '1.0' AUTHOR: hdhosseini NAME: DB_FIX FAMILY: FORUM_E // Block Parameters VAR_INPUT // Input Parameters IN:REAL:=0.0; DW:REAL:=0.5; END_VAR VAR_OUTPUT // Output Parameters OUT:REAL:=0.0; END_VAR IF IN>DW THEN OUT:=IN - DW; END_IF; IF (-DW < IN) AND (IN < DW) THEN OUT:=0.0; END_IF; IF IN < -DW THEN OUT:=IN + DW; END_IF; ; END_FUNCTION_BLOCK[/code] 2-Implement the complex version.Check discussion here. Get PV1 and SP1, calculate error and according to result of internal deadband change the PV2 in newly formed PV for PID algorithm. [code]FUNCTION_BLOCK FB120 TITLE = 'modified_fix width deadband' // // Block Comment... // VERSION: '1.0' AUTHOR: hdhosseini NAME: MDB_FIX FAMILY: FORUM_E // Block Parameters VAR_INPUT // Input Parameters PV1:REAL:=0.0; SP1:REAL:=0.0; DW:REAL:=0.5; END_VAR VAR_OUTPUT // Output Parameters PV2:REAL:=0.0; SP2:REAL:=0.0; END_VAR VAR_TEMP // Temporary Variables buffer:REAL; END_VAR VAR // Static Variables ER:REAL:=0; END_VAR ER:=SP1 -PV1 ; IF ER>DW THEN buffer:=PV1 + DW; END_IF; IF (-DW < ER) AND (ER< DW) THEN buffer:=SP1;; END_IF; IF ER < -DW THEN buffer:=PV1 - DW; END_IF; pv2:=buffer; ; END_FUNCTION_BLOCK [/code] 3- and final test.Two FB41 for controlling 2 loops(reg1,reg2 Instance Data blocks).In reg1 we disable deaband by putting the width to be zero(to provide a controller without deaband ) and for reg2 normal case.SP and PV was same except the process we made for reg1 via FB120.The result was identical as shown in snapshot#2. The whole S7 Project will be also included after consulting with Moderators. Feel free to expand and write your feedbacks Best regards Hamid Hosseini AttachmentNEW_DB_TIP.zip (160 Downloads) |
Last edited by: hdhosseini at: 7/10/2013 5:55 PM// TOTALLY REVISED Last edited by: hdhosseini at: 7/4/2013 11:41 AMLast edited by: hdhosseini at: 7/3/2013 10:13 PM |
|
This contribution was helpful to
5 thankful Users |
7/10/2013 6:12 PM | |
Joined: 1/28/2009 Last visit: 2/21/2023 Posts: 6794 Rating:
|
After major development, new "S7 Program" will be published according previous agreement on issue "28630". Now, you have the source project to test and provide your feedbacks.
AttachmentRegulation.zip (190 Downloads) |
Last edited by: hdhosseini at: 7/11/2013 10:58 AM// Note removed after ACK from Moderators |
|
This contribution was helpful to
1 thankful Users |
Follow us on