Test 2:Force and tension correction

garbage

  • 帖子

    18
  • 精华

    2
  • 被关注

    0

论坛等级:新手

注册时间:2004-10-05

普通 普通 如何晋级?

发布于 2004-10-05 21:34:58

0楼

FUNCTION FC503 : VOID

// This function is used for computing of AEC correction (Force and tension correction).

TITLE = 'AEC_Correction_Calculation'
VERSION : '0.0'
//KNOW_HOW_PROTECT
AUTHOR : BenBen
NAME : AEC_Cor
FAMILY : Common

VAR_INPUT
// Input
Pos_Limit_Force : BOOL; // The positive limit force is reached
Neg_Limit_Force : BOOL; // The negative limit force is reached
Pos_Limit_Tens : BOOL; // The positive limit tension is reached
Neg_Limit_Tens : BOOL; // The negative limit tension is reached
Elong_Force_Val : BOOL; // Elongation treatment in force is running
Elong_Tens_Val : BOOL; // Elongation treatment in tension is running
DF_Delg : REAL; // Force variation according to the elongation variation in Ton/%
DT_Delg : REAL; // Tension variation according to the elongation variation in Kg/%
Da_Dt : REAL; // Elongation variation according time variation (in %/S)
Corr_Tens_Min : REAL; // Minimum tension corretion in Kg
Corr_Tens_Max : REAL; // Maximum tension correction in Kg
New_Setpoint : BOOL; // New setpoint application (raisin edge)
//Parameter
Cycle_Time : INT; // Cycle Time in ms
END_VAR


VAR_IN_OUT
Intg_Out : REAL; // Tension speed Integrate output
END_VAR

VAR_TEMP
Elong_Var_Sgn : BOOL; // Sign of elongation correction (1 if correction is positive)
Temp2 : BOOL; // Bit to switch Force Correction to 0
Temp3 : BOOL; // Bit to switch Tension correction to 0
Temp4 : REAL;
END_VAR

VAR_OUTPUT
Force_AEC_Cor : REAL; // Force correction to reach elongation serpoint
Exit_Tens_AEC_Cor : REAL; // Exit tension correction to reach elongation correction
END_VAR



BEGIN
// Sign of elongation variation (1 if correction is positive)
IF Da_Dt > 0
THEN Elong_Var_Sgn :=1;
ELSE Elong_Var_Sgn :=0;
END_IF;


// Bit to switch Force_Aec_Cor to 0
Temp2:= (Pos_Limit_Force AND Elong_Var_Sgn) OR (Neg_Limit_Force AND NOT Elong_Var_Sgn) OR NOT Elong_Force_Val;

// AEC force correction computing in Ton/s
Force_AEC_Cor:= Da_Dt * DF_Delg;

IF Force_AEC_Cor > 5
THEN Force_AEC_Cor:=5;
ELSIF Force_AEC_Cor < -5
THEN Force_AEC_Cor:= -5;
ELSIF Temp2=1
THEN Force_AEC_Cor:= 0;
END_IF;


// Bit to switch Tension correction to 0
Temp3:= (Pos_Limit_Tens AND Elong_Var_Sgn) OR ( Neg_Limit_Tens AND NOT Elong_Var_Sgn) OR NOT Elong_Tens_Val;



// Tension correction
Temp4:= DT_Delg * Cycle_Time / 1000; // Tension variation according elongation variation for one Time Cycle period in Kg/% for 20ms

IF New_Setpoint
THEN Intg_Out := 0; // Integrate Gains
END_IF;

Exit_Tens_AEC_Cor := Intg_Out+ DT_Delg * Temp4; // Exit tension correction in Kg
Intg_Out := Exit_Tens_AEC_Cor;

IF Exit_Tens_AEC_Cor > Corr_Tens_Min // Tension correction limitation
THEN Exit_Tens_AEC_Cor:= Corr_Tens_Min;
ELSIF Exit_Tens_AEC_Cor > Corr_Tens_Max
THEN Exit_Tens_AEC_Cor:= Corr_Tens_Max;
END_IF;


END_FUNCTION



评论
编辑推荐: 关闭

请填写推广理由:

本版热门话题

SIMATIC S7-300/400

共有54774条技术帖

相关推荐

热门标签

相关帖子推荐

guzhang

恭喜,你发布的帖子

评为精华帖!

快扫描右侧二维码晒一晒吧!

再发帖或跟帖交流2条,就能晋升VIP啦!开启更多专属权限!

  • 分享

  • 只看
    楼主

top
X 图片
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。