PID_FB

PID processing instruction

This implementation allows you to set the parameters of F355_PID directly using arguments:

Parameters

Input

Automatic

FALSE: Manual setting of MV possible

TRUE: Automatic PID controlled MV

Forward (BOOL)

FALSE: Inverse control (heating)

TRUE: Forward control (cooling)

I_PD (BOOL)

FALSE: PI-D control

TRUE: I-PD control

SP (INT)

Set point value, range 0-10000

PV (INT)

Process value, range 0-10000

Kp (INT)

Proportional gain, range: 1-9999, unit: 0.1

Ti (INT)

Integral time, range: 1-30000, unit: 0.1s

Td (INT)

Derivative time, range: 1-10000, unit: 0.1s

Ts (INT)

Sampling time, range: 1-6000, unit: 0.01s

LowerLimit (INT)

MV lower limit, range: 0-10000

UpperLimit (INT)

MV upper limit, range: 1-10000

Input/output

MV (INT)

Manipulated value

Remarks

  • Auto-tuning is not possible using PID_FB. For this, use PID_FB_DUT.

  • The value for MV can be assigned externally either when the program is initialized or when the value of Automatic is FALSE.

  • In order to achieve maximum resolution and minimum dead time beyond LowerLimit and UpperLimit, their values should, if possible, cover the entire range of 0–10000.

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)

if the parameter settings are outside the permissible range

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)

if the parameter settings are outside the permissible range

Example

Global variables

In the global variable list you define variables that can be accessed by all POUs in the project.

POU header

All input and output variables used for programming this function have been declared in the POU header.The same POU header is used for all programming languages.

	VAR_EXTERNAL
		Set_Value_SP: INT:=0;
			(*A/D CH0*)
		Process_Value_PV: INT:=0;
			(*A/D CH1*)
		Output_Value_MV: INT:=0;
			(*D/A*)
	END_VAR
	VAR 
		PID_Control: PID_FB;
			(*PID Parameters*)
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 15 ;
        NETWORK_BODY
B(B_FB,PID_FB!,PID_Control,11,1,19,15,,?BAutomatic?BForward?BI_PD?BSP?BPV?BKp?BTi?BTd?BTs?BLowerLimit?BUpperLimit?BMV?AMV);
B(B_VARIN,,TRUE,9,2,11,4,);
B(B_VARIN,,FALSE,9,3,11,5,);
B(B_VARIN,,FALSE,9,4,11,6,);
B(B_VARIN,,Set_Value_SP,9,5,11,7,);
B(B_VARIN,,Process_Value_PV,9,6,11,8,);
B(B_VARIN,,15,9,7,11,9,);
B(B_VARIN,,200,9,8,11,10,);
B(B_VARIN,,1,9,9,11,11,);
B(B_VARIN,,10,9,10,11,12,);
B(B_VARIN,,0,9,11,11,13,);
B(B_VARIN,,1000,9,12,11,14,);
B(B_VARIN,,Output_Value_MV,9,13,11,15,);
L(1,0,1,15);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

PID_Control( Automatic:= TRUE,
        Forward:= FALSE,
        I_PD:= FALSE,
        SP:= Set_Value_SP,
        PV:= Process_Value_PV,
        Kp:= 15,
        Ti:= 200,
        Td:= 1,
        Ts:= 10,
        LowerLimit:= 0,
        UpperLimit:= 1000,
        MV:= Output_Value_MV);

IL body

Modified on: 2019-01-25Feedback on this pagePanasonic hotline