发布于 2003-09-16 18:19:43
0楼
CALL "CONT_C" , DBx
COM_RST :=FALSE(一定要是0)
MAN_ON :=
PVPER_ON:=TRUE(此项为1,表示使用端口二进制数据)
P_SEL :=TRUE(比例作用选择)
I_SEL :=TRUE(积分作用选择)
INT_HOLD:=
I_ITL_ON:=
D_SEL :=(微分作用选择)
CYCLE :=
SP_INT :=(REAL型给定值)
PV_IN :=(REAL型测量值)
PV_PER :=(WORD型测量值)
MAN :=(手动值)
GAIN :=(增益)
TI :=(积分时间)
TD :=(微分时间)
TM_LAG :=
DEADB_W :=
LMN_HLM :=
LMN_LLM :=
PV_FAC :=
PV_OFF :=
LMN_FAC :=
LMN_OFF :=
I_ITLVAL:=
DISV :=
LMN :=
LMN_PER :=(WORD型调节输出值)
QLMN_HLM:=
QLMN_LLM:=
LMN_P :=
LMN_I :=
LMN_D :=
PV :=
ER :=
其它默认,即什么也不写就行了。详细可以看FB41的在线说明,注意看它的那个图
Continuous Control with SFB 41/FB 41 "CONT_C"
Introduction
SFB/FB "CONT_C" is used on SIMATIC S7 programmable logic controllers to control technical processes with continuous input and output variables. During parameter assignment, you can activate or deactivate sub-functions of the PID controller to adapt the controller to the process. You can assign this easily by using the parameter assignment tool (Menu path: Start > Simatic > Step7 > Assign PID Control parameters). The online electronic manual is found under Start > Simatic > Step7 > Assign PID Control English.
Application
You can use the controller as a PID fixed setpoint controller or in multi-loop controls as a cascade, blending or ratio controller. The functions of the controller are based on the PID control algorithm of the sampling controller with an analog signal, if necessary extended by including a pulse generator stage to generate pulse duration modulated output signals for two or three step controllers with proportional actuators.
Des cription
Apart from the functions in the setpoint and process value branches, the SFB/FB implements a complete PID controller with continuous manipulated variable output and the option of influencing the manipulated value manually. In the following, you will find a detailed des cription of the sub-functions:
Setpoint Branch
The setpoint is entered in floating-point format at the SP_INT input.
Process Variable Branch
The process variable can be input in the peripheral (I/O) or floating-point format. The CRP_IN function converts the PV_PER peripheral value to a floating-point format of -100 to +100 % according to the following formula:
The PV_NORM function normalizes the output of CRP_IN according to the following formula:
Output of PV_NORM = (output of CPR_IN) * PV_FAC + PV_OFF
PV_FAC has a default of 1 and PV_OFF a default of 0.
Error Signal
The difference between the setpoint and process variable is the error signal. To suppress a small constant oscillation due to the manipulated variable quantization (for example, in pulse duration modulation with PULSEGEN), a dead band is applied to the error signal (DEADBAND). If DEADB_W = 0, the dead band is switched off.
PID Algorithm
The PID algorithm operates as a position algorithm. The proportional, integral (INT), and derivative (DIF) actions are connected in parallel and can be activated or deactivated individually. This allows P, PI, PD, and PID controllers to be configured. Pure I and D controllers are also possible.
Manual Value
It is possible to switch over between a manual and an automatic mode. In the manual mode, the manipulated variable is corrected to a manually selected value. The integrator (INT) is set internally to LMN - LMN_P - DISV and the derivative unit (DIF) to 0 and matched internally. This means that a switchover to the automatic mode does not cause any sudden change in the manipulated value.
Manipulated Value
The manipulated value can be limited to a selected value using the LMNLIMIT function. Signaling bits indicate when a limit is exceeded by the input variable.
The LMN_NORM function normalizes the output of LMNLIMIT according to the following formula:
LMN = (output of LMNLIMIT) * LMN_FAC + LMN_OFF
LMN_FAC has the default 1 and LMN_OFF the default 0.
The manipulated value is also available in the peripheral format. The CPR_OUT function converts the floating-point value LMN to a peripheral value according to the following formula:
Feed Forward Control
A disturbance variable can be fed forward at the DISV input.
Initialization
SFB 41 "CONT_C" has an initialization routine that is run through when the input parameter COM_RST = TRUE is set.
During initialization, the integrator is set internally to the initialization value I_ITVAL. When it is called in a cyclic interrupt priority class, it then continues to work starting at this value.
All other outputs are set to their default values.
Error Information
The error output parameter RET_VAL is not used.
CONT_C Block Diagram
Input Parameters
The following table contains the des cription of the input parameters for SFB 41/FB 41 "CONT_C."
Parameter Data Type Range of Values Default Des cription
COM_RST BOOL FALSE COMPLETE RESTART
The block has an initialization routine that is
processed when the input COM_RST is set.
MAN_ON BOOL TRUE MANUAL VALUE ON
If the input "manual value on" is set, the
control loop is interrupted. A manual value
is set as the manipulated value.
PVPER_ON BOOL FALSE PROCESS VARIABLE PERIPHERAL ON
If the process variable is read from the I/Os,
the input PV_PER must be connected to
the I/Os and the input "process variable
peripheral on" must be set.
P_SEL BOOL TRUE PROPORTIONAL ACTION ON
The PID actions can be activated or
deactivated individually in the PID
algorithm. The P action is on when the input
"proportional action on" is set.
I_SEL BOOL TRUE INTEGRAL ACTION ON
The PID actions can be activated or
deactivated individually in the PID
algorithm. The I action is on when the input
"integral action on" is set.
INT_HOLD BOOL FALSE INTEGRAL ACTION HOLD
The output of the integrator can be "frozen"
by setting the input "integral action hold."
I_ITL_ON BOOL FALSE INITIALIZATION OF THE INTEGRAL
ACTION ON
The output of the integrator can be
connected to the input I_ITL_VAL by setting
the input "initialization of the integral action
on."
D_SEL BOOL FALSE DERIVATIVE ACTION ON
The PID actions can be activated or
deactivated individually in the PID
algorithm. The D action is on when the
input "derivative action on" is set.
CYCLE TIME >= 1 ms T#1s SAMPLING TIME
The time between the block calls must be
constant. The "sampling time" input
specifies the time between block calls.
SP_INT REAL -100.0 to +100.0
(%) or phys. value 1) 0.0 INTERNAL SETPOINT
The "internal setpoint" input is used to
specify a setpoint.
PV_IN REAL -100.0 to +100.0
(%) or phys. Value
1) 0.0 PROCESS VARIABLE IN
An initialization value can be set at the
"process variable in" input or an external
process variable in floating point format can
be connected.
PV_PER WORD W#16#0000 PROCESS VARIABLE PERIPHERAL
The process variable in the I/O format is
connected to the controller at the "process
variable peripheral" input.
MAN REAL -100.0 to +100.0
(%) or phys. Value
2) 0.0 MANUAL VALUE
The "manual value" input is used to set a
manual value using the operator interface
functions.
GAIN REAL 2.0 PROPORTIONAL GAIN
The "proportional value" input specifies the
controller gain.
TI TIME >= CYCLE T#20s RESET TIME
The "reset time" input determines the time
response of the integrator.
TD TIME >= CYCLE T#10s DERIVATIVE TIME
The "derivative time" input determines the
time response of the derivative unit.
TM_LAG TIME >= CYCLE/2 T#2s TIME LAG OF THE DERIVATIVE ACTION
The algorithm of the D action includes a
time lag that can be assigned at the "time
lag of the derivative action" input.
DEADB_W REAL >= 0.0 (%)
or phys. Value 1) 0.0 DEAD BAND WIDTH
A dead band is applied to the error. The
"dead band width" input determines the size
of the dead band.
LMN_HLM REAL LMN_LLM ...100.0 (%)
or phys. Value 2) 100.0 MANIPULATED VALUE HIGH LIMIT
The manipulated value is always limited by
an upper and lower limit. The "manipulated
value high limit" input specifies the upper
limit.
LMN_LLM REAL -100.0... LMN_HLM (%)
or phys. Value 2) 0.0 MANIPULATED VALUE LOW LIMIT
The manipulated value is always limited by
an upper and lower limit. The "manipulated
value low limit" input specifies the lower limit.
PV_FAC REAL 1.0 PROCESS VARIABLE FACTOR
The "process variable factor" input is
multiplied by the process variable. The
input is used to adapt the process variable
range.
PV_OFF REAL 0.0 PROCESS VARIABLE OFFSET
The "process variable offset" input is added
to the process variable. The input is used to
adapt the process variable range.
LMN_FAC REAL 1.0 MANIPULATED VALUE FACTOR
The "manipulated value factor" input is
multiplied by the manipulated value. The
input is used to adapt the manipulated
value range.
LMN_OFF REAL 0.0 MANIPULATED VALUE OFFSET
The "manipulated value offset" is added to
the manipulated value. The input is used to
adapt the manipulated value range.
I_ITLVAL REAL -100.0 to +100.0
(%)or phys. Value 2) 0.0 INITIALIZATION VALUE OF THE INTEGRAL ACTION
The output of the integrator can be set at
input I_ITL_ON. The initialization value is
applied to the input "initialization value of
the integral action."
DISV REAL -100.0 to +100.0
(%)or phys. Value 2) 0.0 DISTURBANCE VARIABLE
For feed forward control, the disturbance
variable is connected to input "disturbance
variable."
1) Parameters in the setpoint and process variable branches with the same unit
2) Parameters in the manipulated value branch with the same unit
Output Parameters
The following table contains the des cription of the output parameters for SFB 41/FB41 "CONT_C."
Parameter Data Type Range of Values Default Des cription
LMN REAL 0.0 MANIPULATED VALUE
The effective manipulated value is output in
floating point format at the "manipulated
value" output.
LMN_PER WORD W#16#0000 MANIPULATED VALUE PERIPHERAL
The manipulated value in the I/O format is
connected to the controller at the
"manipulated value peripheral" output.
QLMN_HLM BOOL FALSE HIGH LIMIT OF MANIPULATED VALUE
REACHED
The manipulated value is always limited to
an upper and lower limit. The output "high
limit of manipulated value reached"
indicates that the upper limit has been
exceeded.
QLMN_LLM BOOL FALSE LOW LIMIT OF MANIPULATED VALUE
REACHED
The manipulated value is always limited to
an upper and lower limit. The output "low
limit of manipulated value reached"
indicates that the lower limit has been
exceeded.
LMN_P REAL 0.0 PROPORTIONAL COMPONENT
The "proportional component" output
contains the proportional component of the
manipulated variable.
LMN_I REAL 0.0 INTEGRAL COMPONENT
The "integral component" output contains
the integral component of the manipulated
value.
LMN_D REAL 0.0 DERIVATIVE COMPONENT
The "derivative component" output contains
the derivative component of the
manipulated value.
PV REAL 0.0 PROCESS VARIABLE
The effective process variable is output at
the "process variable" output.
ER REAL 0.0 ERROR SIGNAL
The effective error is output at the "error
signal" output.
我喜欢SIEMENS,因为它有如此多的缺陷,却还有如此多的用户,想不明白!