Commit 95e99d16 authored by Claes Sjofors's avatar Claes Sjofors

Plc control, new algorithm for PID and CompPID, and windup limit in Inc3P-object (refs #177)

parent 16ed5c5d
...@@ -240,6 +240,11 @@ void CompPID_Fo_init( pwr_sClass_CompPID_Fo *o) ...@@ -240,6 +240,11 @@ void CompPID_Fo_init( pwr_sClass_CompPID_Fo *o)
#define DALG 8 /* Derivative part exists */ #define DALG 8 /* Derivative part exists */
#define DAVV 16 /* Derivative part working on control difference */ #define DAVV 16 /* Derivative part working on control difference */
#define IWUP 1 /* Windup limitation on I part */
#define BIWUP 2 /* Windup limitation on Bias and I part */
#define BPIWUP 4 /* Windup limitation on Bias PI part */
#define BPIDWUP 8 /* Windup limitation on Bias and PID part (Default, old funcionality */
void CompPID_Fo_exec( plc_sThread *tp, void CompPID_Fo_exec( plc_sThread *tp,
pwr_sClass_CompPID_Fo *o) pwr_sClass_CompPID_Fo *o)
{ {
...@@ -252,6 +257,9 @@ void CompPID_Fo_exec( plc_sThread *tp, ...@@ -252,6 +257,9 @@ void CompPID_Fo_exec( plc_sThread *tp,
float ut; float ut;
float dut; float dut;
float kd; float kd;
float absut;
float gain;
pwr_sClass_CompPID *co = (pwr_sClass_CompPID *) o->PlcConnectP; pwr_sClass_CompPID *co = (pwr_sClass_CompPID *) o->PlcConnectP;
if ( !co) if ( !co)
...@@ -284,104 +292,120 @@ void CompPID_Fo_exec( plc_sThread *tp, ...@@ -284,104 +292,120 @@ void CompPID_Fo_exec( plc_sThread *tp,
ddiff = ((co->PidAlg & DAVV) != 0) ? ddiff = ((co->PidAlg & DAVV) != 0) ?
(co->ControlDiff - eold) / *o->ScanTime: (co->ControlDiff - eold) / *o->ScanTime:
(co->ProcVal - xold) / *o->ScanTime; (co->ProcVal - xold) / *o->ScanTime;
if ((co->DerGain <= 0.0) || (co->DerTime <= 0)) if (((co->DerGain * *o->ScanTime) >= co->DerTime) || (co->DerTime <= 0))
co->FiltDer = ddiff; /* No Filter */ co->FiltDer = ddiff; /* No Filter */
else { else {
kd = 1.0 / (1.0 + co->DerGain * *o->ScanTime / co->DerTime); kd = 1.0 / (1.0 + co->DerGain * *o->ScanTime / co->DerTime);
co->FiltDer += (ddiff - derold) * (1.0 - kd); co->FiltDer += (ddiff - derold) * (1.0 - kd);
} }
if (co->Inverse == 0) gain = co->Gain;
else gain = -co->Gain;
if ( co->Force ) { if ( co->Force ) {
/* Force */ /* Force */
dut = co->OutVal; co->OutChange = co->ForcVal - co->OutVal;
co->OutVal = co->ForcVal; co->OutVal = co->OutWindup = co->ForcVal;
co->OutChange = co->OutVal - dut;
co->EndMin = FALSE; co->EndMin = FALSE;
co->EndMax = FALSE; co->EndMax = FALSE;
/* Adjust for bumpless transfer to auto */
co->PDManOffset = co->OutVal -
gain * co->ControlDiff - co->BiasGain * co->Bias;
if ((co->PidAlg & IALG) != 0) co->AbsOut = 0.0;
else co->AbsOut = co->OutVal;
if (co->WindupMask < BIWUP)
co->OutWindup -= co->BiasGain * co->Bias;
if (co->WindupMask < BPIWUP)
co->OutWindup -= gain * co->ControlDiff;
co->AbsOut = co->OutVal - co->OutWindup;
} }
else { else {
/* Auto mode */ /* Auto mode */
if ((co->PidAlg & IALG) != 0) {
/* Incremental algorithm */ dut = absut = 0.0;
if ((co->PidAlg & IALG) != 0)
/* Incremental algorithm */
{
/* Integral-part */ /* Integral-part */
if ((*o->IntOffP == FALSE) && (co->IntTime > 0)) if ((*o->IntOffP == FALSE) && (co->IntTime > 0))
dut = co->ControlDiff * *o->ScanTime / co->IntTime; dut = co->ControlDiff * *o->ScanTime / co->IntTime;
if ((co->PidAlg & PALG) != 0) dut *= gain;
else gain = 0.0; /* Pure I-controller */
/* Bias */
if (co->WindupMask >= BIWUP) /* Windup on Bias */
dut += co->BiasGain * (co->Bias - bfold);
else absut = co->BiasGain * co->Bias;
/* P-part */
if (co->WindupMask >= BPIWUP) /* Windup on P */
dut += ((co->PidAlg & PAVV) != 0) ?
gain * (co->ControlDiff - eold) :
gain * (co->ProcVal - xold) ;
else else
dut = 0; absut += gain * co->ControlDiff;
if ((co->PidAlg & PALG) != 0) {
/* Not pure I-controller */ /* Derivative-part */
/* Derivative-part */ if ((co->PidAlg & DALG) != 0) {
if ((co->PidAlg & DALG) != 0) if (co->WindupMask >= BPIDWUP) /* Windup on D */
dut += (co->FiltDer-derold) * co->DerTime; dut += gain * (co->FiltDer - derold) * co->DerTime;
/* P-part */ else
dut += ((co->PidAlg & PAVV) != 0) ? absut += gain * co->FiltDer * co->DerTime;
co->ControlDiff - eold :
co->ProcVal - xold ;
dut *= co->Gain;
} }
if (co->Inverse != 0) dut = - dut;
/* Bias */
dut += co->BiasGain * (co->Bias - bfold);
/* Limit output */ /* Limit output */
ut = co->OutVal + dut; co->OutWindup += dut;
if (co->MaxOut > co->MinOut) {
if (ut > co->MaxOut) { if (co->OutWindup > co->MaxWindup) {
ut = co->MaxOut; co->OutWindup = co->MaxWindup;
co->EndMin = FALSE; co->EndMax = TRUE;
co->EndMax = TRUE; } else if (co->OutWindup < co->MinWindup) {
} co->OutWindup = co->MinWindup;
else if (ut < co->MinOut) { co->EndMin = TRUE;
ut = co->MinOut;
co->EndMin = TRUE;
co->EndMax = FALSE;
}
else {
if (co->EndMin && (ut >= (co->MinOut + co->EndHys)))
co->EndMin = FALSE;
if (co->EndMax && (ut <= (co->MaxOut - co->EndHys)))
co->EndMax = FALSE;
}
} }
ut = co->OutWindup + absut;
if (ut > co->MaxOut) ut = co->MaxOut;
else if (ut < co->MinOut) ut = co->MinOut;
dut += absut - co->AbsOut;
} }
else { else
/* Nonincremental algorithm */ /* Nonincremental algorithm */
{
/* P-part */ /* P-part */
ut = co->ControlDiff; ut = co->ControlDiff;
/* Derivative-part */ /* Derivative-part */
if ((co->PidAlg & DALG) != 0) if ((co->PidAlg & DALG) != 0)
ut += co->FiltDer * co->DerTime; ut += co->FiltDer * co->DerTime;
/* Gain */ /* Gain */
ut *= co->Gain; ut *= gain;
if (co->Inverse != 0) ut = - ut;
/* Bias */ /* Bias and Man offset*/
ut += co->BiasGain * co->Bias; if (co->PDAbsFlag) co->PDManOffset = 0;
ut += co->BiasGain * co->Bias + co->PDManOffset;
/* Limit output */ /* Limit output */
if (co->MaxOut > co->MinOut) { if (co->MaxOut > co->MinOut)
if (ut > co->MaxOut) { {
ut = co->MaxOut; if (ut > co->MaxOut) ut = co->MaxOut;
co->EndMin = FALSE; else if (ut < co->MinOut) ut = co->MinOut;
co->EndMax = TRUE;
}
else if (ut < co->MinOut) {
ut = co->MinOut;
co->EndMin = TRUE;
co->EndMax = FALSE;
}
else {
if (co->EndMin && (ut >= (co->MinOut + co->EndHys)))
co->EndMin = FALSE;
if (co->EndMax && (ut <= (co->MaxOut - co->EndHys)))
co->EndMax = FALSE;
}
} }
dut = ut - co->OutVal; dut = ut - co->OutVal;
absut = ut;
} }
/* Output Auto */ /* Output Auto */
co->OutChange = dut; co->OutChange = dut;
co->OutVal = ut; co->OutVal = ut;
co->AbsOut = absut;
} }
/* Transfer outputs */ /* Transfer outputs */
......
...@@ -51117,10 +51117,9 @@ and no Auto/Man button." ...@@ -51117,10 +51117,9 @@ and no Auto/Man button."
! XSetVal. ! XSetVal.
!*/ !*/
Object SetVal $Attribute 7 18-MAY-2006 14:34:02.85 Object SetVal $Attribute 7 18-MAY-2006 14:34:02.85
Body SysBody 18-MAY-2006 15:34:43.61 Body SysBody 27-MAR-2014 07:39:05.83
Attr PgmName = "SetVal" Attr PgmName = "SetVal"
Attr Size = 4 Attr Size = 4
Attr Flags = 1040
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
...@@ -51288,99 +51287,100 @@ and no Auto/Man button." ...@@ -51288,99 +51287,100 @@ and no Auto/Man button."
EndBody EndBody
EndObject EndObject
!/** !/**
! The operator's authorities to change SetVal.
!
! 0 -- Changes not allowed.
! = 0 -- Changes allowed.
!*/
Object AccSet $Attribute 18 18-MAY-2006 14:35:28.87
Body SysBody 18-MAY-2006 14:39:48.69
Attr PgmName = "AccSet"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! The choice of the operator of SetVal is checked against
! the interval { MinSet, MaxSet}. The value may be
! changed in the control modes MANUAL and AUTO from the
! display of the Mode object.
!*/
Object MinSet $Attribute 19 18-MAY-2006 14:35:33.96
Body SysBody 18-MAY-2006 14:39:55.12
Attr PgmName = "MinSet"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxSet $Attribute 20 18-MAY-2006 14:35:37.63
Body SysBody 18-MAY-2006 14:39:58.39
Attr PgmName = "MaxSet"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! The lower respectively upper limits in the bar graphs ! The lower respectively upper limits in the bar graphs
! at presentation of process and set point values in the ! at presentation of process and set point values in the
! Mode object display. The values may be changed in the ! Mode object display. The values may be changed in the
! more info form of the Mode object. ! more info form of the Mode object.
!*/ !*/
Object SetMaxShow $Attribute 21 18-MAY-2006 14:35:43.48 Object SetMinShow $Attribute 22 27-MAR-2014 08:02:34.71
Body SysBody 18-MAY-2006 14:40:01.58 Body SysBody 18-MAY-2006 14:40:04.58
Attr PgmName = "SetMaxShow" Attr PgmName = "SetMinShow"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
Object SetMinShow $Attribute 22 18-MAY-2006 14:35:47.67 Object SetMaxShow $Attribute 21 27-MAR-2014 08:02:37.36
Body SysBody 18-MAY-2006 14:40:04.58 Body SysBody 18-MAY-2006 14:40:01.58
Attr PgmName = "SetMinShow" Attr PgmName = "SetMaxShow"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the engineering unit of SetVal / XSetVal / SetMinShow /
! SetMaxShow, e.g. kg. Used in the Mode object display.
! OutEngUnit
!*/
Object SetEngUnit $Attribute 25 27-MAR-2014 08:02:40.12
Body SysBody 18-MAY-2006 14:40:48.75
Attr PgmName = "SetEngUnit"
Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! The lower respectively upper limits in the bar graph at ! The lower respectively upper limits in the bar graph at
! presentation of the control signal, OutVal, of the Pid ! presentation of the control signal, OutVal, of the Pid
! object in the Mode display. The values may be changed ! object in the Mode display. The values may be changed
! in the more info form of the Mode object. ! in the more info form of the Mode object.
!*/ !*/
Object OutMaxShow $Attribute 23 18-MAY-2006 14:35:53.81 Object OutMinShow $Attribute 24 27-MAR-2014 08:02:43.20
Body SysBody 18-MAY-2006 14:40:09.36 Body SysBody 18-MAY-2006 14:40:13.52
Attr PgmName = "OutMaxShow" Attr PgmName = "OutMinShow"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
Object OutMinShow $Attribute 24 18-MAY-2006 14:36:06.19 Object OutMaxShow $Attribute 23 27-MAR-2014 08:02:46.40
Body SysBody 18-MAY-2006 14:40:13.52 Body SysBody 18-MAY-2006 14:40:09.36
Attr PgmName = "OutMinShow" Attr PgmName = "OutMaxShow"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the engineering unit of SetMinShow / ! Specifies the engineering unit of OutVal / Force /
! SetMaxShow, e.g. kg. Used in the Mode object display. ! OutMinShow / OutMaxShow e.g. %.
! OutEngUnit ! Used in the Mode object display.
!*/ !*/
Object SetEngUnit $Attribute 25 18-MAY-2006 14:36:17.79 Object OutEngUnit $Attribute 26 27-MAR-2014 08:02:49.27
Body SysBody 18-MAY-2006 14:40:48.75 Body SysBody 18-MAY-2006 14:40:51.89
Attr PgmName = "SetEngUnit" Attr PgmName = "OutEngUnit"
Attr Size = 16 Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16" Attr TypeRef = "pwrs:Type-$String16"
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the engineering unit of OutMinShow / ! The operator's authorities to change SetVal.
! OutMaxShow e.g. %. Used in the Mode object display. !
! 0 -- Changes not allowed.
! = 0 -- Changes allowed.
!*/ !*/
Object OutEngUnit $Attribute 26 18-MAY-2006 14:36:23.64 Object AccSet $Attribute 18 18-MAY-2006 14:35:28.87
Body SysBody 18-MAY-2006 14:40:51.89 Body SysBody 18-MAY-2006 14:39:48.69
Attr PgmName = "OutEngUnit" Attr PgmName = "AccSet"
Attr Size = 16 Attr Size = 4
Attr TypeRef = "pwrs:Type-$String16" Attr TypeRef = "pwrs:Type-$Int32"
EndBody
EndObject
!/**
! The choice of the operator of SetVal is checked against
! the interval { MinSet, MaxSet}. The value may be
! changed in the control modes MANUAL and AUTO from the
! display of the Mode object.
!*/
Object MinSet $Attribute 19 18-MAY-2006 14:35:33.96
Body SysBody 18-MAY-2006 14:39:55.12
Attr PgmName = "MinSet"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxSet $Attribute 20 18-MAY-2006 14:35:37.63
Body SysBody 18-MAY-2006 14:39:58.39
Attr PgmName = "MaxSet"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -51718,7 +51718,7 @@ and no Auto/Man button." ...@@ -51718,7 +51718,7 @@ and no Auto/Man button."
Object RtBody $ObjBodyDef 1 18-MAY-2006 14:49:52.65 Object RtBody $ObjBodyDef 1 18-MAY-2006 14:49:52.65
Body SysBody 18-MAY-2006 14:49:57.64 Body SysBody 18-MAY-2006 14:49:57.64
Attr StructName = "CompPID" Attr StructName = "CompPID"
Attr NextAix = "_X50" Attr NextAix = "_X57"
EndBody EndBody
!/** !/**
! Process value. ! Process value.
...@@ -51900,7 +51900,7 @@ and no Auto/Man button." ...@@ -51900,7 +51900,7 @@ and no Auto/Man button."
! based on the control error. ! based on the control error.
!*/ !*/
Object PidAlg $Attribute 12 18-MAY-2006 15:12:04.04 Object PidAlg $Attribute 12 18-MAY-2006 15:12:04.04
Body SysBody 18-MAY-2006 15:20:47.24 Body SysBody 27-MAR-2014 07:30:20.83
Attr PgmName = "PidAlg" Attr PgmName = "PidAlg"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrb:Type-PidAlgEnum" Attr TypeRef = "pwrb:Type-PidAlgEnum"
...@@ -51969,7 +51969,7 @@ and no Auto/Man button." ...@@ -51969,7 +51969,7 @@ and no Auto/Man button."
! decreasing control signal. ! decreasing control signal.
!*/ !*/
Object Inverse $Attribute 17 18-MAY-2006 15:12:26.34 Object Inverse $Attribute 17 18-MAY-2006 15:12:26.34
Body SysBody 18-MAY-2006 15:21:26.53 Body SysBody 27-MAR-2014 07:28:57.76
Attr PgmName = "Inverse" Attr PgmName = "Inverse"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Boolean" Attr TypeRef = "pwrs:Type-$Boolean"
...@@ -51990,18 +51990,66 @@ and no Auto/Man button." ...@@ -51990,18 +51990,66 @@ and no Auto/Man button."
EndBody EndBody
EndObject EndObject
!/** !/**
! At AUTO and CASCADE control the control signal OutVal ! Flag to force no offset after amnual mode. Will cause an output jump
! is supposed to be in the interval { MinOut, MaxOut }. ! when switching from manual to Auto. Not Bumpless transfer!
! The EndMin /EndMax flags are used to signal if any !*/
! limitation has occurred. Object PDAbsFlag $Attribute 50 27-MAR-2014 07:28:33.85
! If OutVal is greater than MaxOut or less than MinOut, Body SysBody 27-MAR-2014 07:29:01.36
! OutVal is limited to the value at the end of the Attr PgmName = "PDAbsFlag"
! interval. Attr Flags = 16777216
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! WindupMask
! The possible values are as follows:
!
! 1 -- I Only the I-part is limited in OutWindup
! 2 -- BI Bias and I are limited in OutWindup
! 4 -- BPI Bias, P and I are limited in OutWindup
! 8 -- BPID All parts of the controller are limited in OutWindup
!*/
Object WindupMask $Attribute 51 27-MAR-2014 07:30:11.91
Body SysBody 27-MAR-2014 07:30:41.64
Attr PgmName = "WindupMask"
Attr Flags = 16777216
Attr TypeRef = "pwrb:Type-WindupMaskEnum"
EndBody
EndObject
!/**
! At AUTO and CASCADE control, for controllers with an I-part,
! the control signal OutWindup is supposed to be
! in the interval { MinWindup, MaxWindup }.
! The EndMin / EndMax flags are used to signal if any
! limitation has ocurred.
! If OutWindup is greater than MaxWindup, or less than MinWindup,
! OutWindup is limited to the value at the end of the interval.
! If MinWindup >= MaxWindup no limitation will occur.
!
! After addition of the absolute part,
! OutVal is limited to the interval { MinOut, MaxOut }.
! If MinOut >= MaxOut no limitation will occur.
!
!*/
Object MinWindup $Attribute 52 27-MAR-2014 07:31:26.25
Body SysBody 27-MAR-2014 07:31:28.04
Attr PgmName = "MinWindup"
Attr Flags = 16777216
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object MaxWindup $Attribute 53 27-MAR-2014 07:31:36.34
Body SysBody 27-MAR-2014 07:31:37.96
Attr PgmName = "MaxWindup"
Attr Flags = 16777216
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! !
! If MinOut >= MaxOut no limitation will occur.
!*/ !*/
Object MinOut $Attribute 19 18-MAY-2006 15:15:23.71 Object MinOut $Attribute 19 18-MAY-2006 15:15:23.71
Body SysBody 18-MAY-2006 15:22:31.22 Body SysBody 27-MAR-2014 07:31:06.73
Attr PgmName = "MinOut" Attr PgmName = "MinOut"
Attr Size = 4 Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
...@@ -52015,6 +52063,81 @@ and no Auto/Man button." ...@@ -52015,6 +52063,81 @@ and no Auto/Man button."
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the hysteresis on MinOut and MaxOut in
! connection with the handling of EndMin/EndMax.
! @image orm_en1-144.gif
!*/
Object EndHys $Attribute 47 27-MAR-2014 07:31:58.98
Body SysBody 18-MAY-2006 15:25:54.52
Attr PgmName = "EndHys"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of ProcVal and SetVal in the Pid object
! display. The values may be changed in the more info
! form of the Pid object.
!*/
Object SetMinShow $Attribute 41 27-MAR-2014 07:32:06.25
Body SysBody 18-MAY-2006 15:24:38.58
Attr PgmName = "SetMinShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object SetMaxShow $Attribute 40 27-MAR-2014 07:32:09.87
Body SysBody 18-MAY-2006 15:24:32.20
Attr PgmName = "SetMaxShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Specifies the engineering unit of SetVal / SetMinShow /
! SetMaxShow, e.g. meter. Used in the Pid object display.
!*/
Object SetEngUnit $Attribute 44 27-MAR-2014 07:32:13.42
Body SysBody 18-MAY-2006 15:25:29.00
Attr PgmName = "SetEngUnit"
Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of the control signal OutVal in the Pid
! object display. The values may be changed in the more
! info form of the Pid object.
!*/
Object OutMinShow $Attribute 43 27-MAR-2014 07:32:20.89
Body SysBody 18-MAY-2006 15:24:44.30
Attr PgmName = "OutMinShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object OutMaxShow $Attribute 42 27-MAR-2014 07:32:24.40
Body SysBody 18-MAY-2006 15:24:41.44
Attr PgmName = "OutMaxShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Specifies the engineering unit of OutVal / OutMinShow /
! OutMaxShow, e.g., %. Used in the in the Pid object
! display.
!*/
Object OutEngUnit $Attribute 45 27-MAR-2014 07:32:27.14
Body SysBody 18-MAY-2006 15:25:32.42
Attr PgmName = "OutEngUnit"
Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! The operator's authorities to change Gain respectively ! The operator's authorities to change Gain respectively
! IntTime. ! IntTime.
! 0 -- Changes not allowed. ! 0 -- Changes not allowed.
...@@ -52181,69 +52304,6 @@ and no Auto/Man button." ...@@ -52181,69 +52304,6 @@ and no Auto/Man button."
EndBody EndBody
EndObject EndObject
!/** !/**
! The lower respectively upper limit in the graph at
! presentation of ProcVal and SetVal in the Pid object
! display. The values may be changed in the more info
! form of the Pid object.
!*/
Object SetMaxShow $Attribute 40 18-MAY-2006 15:17:50.62
Body SysBody 18-MAY-2006 15:24:32.20
Attr PgmName = "SetMaxShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object SetMinShow $Attribute 41 18-MAY-2006 15:17:57.23
Body SysBody 18-MAY-2006 15:24:38.58
Attr PgmName = "SetMinShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of the control signal OutVal in the Pid
! object display. The values may be changed in the more
! info form of the Pid object.
!*/
Object OutMaxShow $Attribute 42 18-MAY-2006 15:18:01.66
Body SysBody 18-MAY-2006 15:24:41.44
Attr PgmName = "OutMaxShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object OutMinShow $Attribute 43 18-MAY-2006 15:18:07.98
Body SysBody 18-MAY-2006 15:24:44.30
Attr PgmName = "OutMinShow"
Attr Size = 4
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Specifies the engineering unit of SetMinShow /
! SetMaxShow, e.g. meter. Used in the Pid object display.
!*/
Object SetEngUnit $Attribute 44 18-MAY-2006 15:18:13.35
Body SysBody 18-MAY-2006 15:25:29.00
Attr PgmName = "SetEngUnit"
Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! Specifies the engineering unit of OutMinShow /
! OutMaxShow, e.g., %. Used in the in the Pid object
! display.
!*/
Object OutEngUnit $Attribute 45 18-MAY-2006 15:18:20.75
Body SysBody 18-MAY-2006 15:25:32.42
Attr PgmName = "OutEngUnit"
Attr Size = 16
Attr TypeRef = "pwrs:Type-$String16"
EndBody
EndObject
!/**
! Specifies the complete name of the Mode object ! Specifies the complete name of the Mode object
! associated to this Pid object. The attribute makes it ! associated to this Pid object. The attribute makes it
! possible to start the object display of the associated ! possible to start the object display of the associated
...@@ -52258,24 +52318,46 @@ and no Auto/Man button." ...@@ -52258,24 +52318,46 @@ and no Auto/Man button."
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the hysteresis on MinOut and MaxOut in ! Filtered derivative is saved to the next program cycle.
! connection with the handling of EndMin/EndMax.
! @image orm_en1-144.gif
!*/ !*/
Object EndHys $Attribute 47 18-MAY-2006 15:18:32.65 Object FiltDer $Attribute 48 18-MAY-2006 15:18:37.56
Body SysBody 18-MAY-2006 15:25:54.52 Body SysBody 27-MAR-2014 07:39:57.84
Attr PgmName = "EndHys" Attr PgmName = "FiltDer"
Attr Size = 4 Attr Size = 4
Attr Flags = 1040
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
!/** !/**
! Filtered derivative is saved to the next program cycle. ! Offset for P / PD-Controller after switching from
! manual to auto mode.
!
!*/ !*/
Object FiltDer $Attribute 48 18-MAY-2006 15:18:37.56 Object PDManOffset $Attribute 54 27-MAR-2014 07:33:39.89
Body SysBody 18-MAY-2006 15:25:57.72 Body SysBody 27-MAR-2014 07:40:16.83
Attr PgmName = "FiltDer" Attr PgmName = "PDManOffset"
Attr Size = 4 Attr Flags = 16778256
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! Output that is limited with MinWindup and MaxWindup
!
!*/
Object OutWindup $Attribute 55 27-MAR-2014 07:34:23.42
Body SysBody 27-MAR-2014 07:43:44.08
Attr PgmName = "OutWindup"
Attr Flags = 16778256
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
!/**
! The absolute part of the output. (contrary to OutWindup)
!*/
Object AbsOut $Attribute 56 27-MAR-2014 07:35:01.12
Body SysBody 27-MAR-2014 07:43:54.26
Attr PgmName = "AbsOut"
Attr Flags = 16778256
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
EndBody EndBody
EndObject EndObject
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "pwr_baseclasses.h" #include "pwr_baseclasses.h"
#include "rt_plc.h" #include "rt_plc.h"
#include "rt_plc_timer.h" #include "rt_plc_timer.h"
#include "rt_plc_pid.h"
/* PLC RUTINER */ /* PLC RUTINER */
...@@ -53,9 +52,13 @@ ...@@ -53,9 +52,13 @@
function: accumulate output change from controller function: accumulate output change from controller
and convert to Open or Close orders. and convert to Open or Close orders.
2014-02-18 Werner Limit acc to new attribute "MaxWindup"
@aref inc3p Inc3p @aref inc3p Inc3p
*/ */
void inc3p_init( pwr_sClass_inc3p *object)
void inc3p_init(
pwr_sClass_inc3p *object)
{ {
object->Acc = 0; object->Acc = 0;
} }
...@@ -157,6 +160,13 @@ void inc3p_exec( ...@@ -157,6 +160,13 @@ void inc3p_exec(
} }
} }
} }
/* Limit output 2014-02-18 / Werner */
if ((object->Acc > object->MaxWindup) && (object->MaxWindup > 0.0))
object->Acc = object->MaxWindup;
if ((object->Acc < -object->MaxWindup) && (object->MaxWindup > 0.0))
object->Acc = -object->MaxWindup;
} }
/*_* /*_*
...@@ -355,15 +365,19 @@ void mode_exec( ...@@ -355,15 +365,19 @@ void mode_exec(
Possible to turn off integration and to force Possible to turn off integration and to force
output to desired value. output to desired value.
Revision: 2011-01-18 / Werner New Attributes 2014-02-18 / Werner:
Error in filtered derivate part corrected. WindupMask Config
MinWindup Config
MaxWindup Config
PDManOffset Internal
OutWindup Internal
@aref pid Pid @aref pid Pid
*/ */
void pid_exec( void pid_exec(
plc_sThread *tp, plc_sThread *tp,
pwr_sClass_pid *object) pwr_sClass_pid *object)
{ {
/* Define Algoritm bitmask */ /* Define Algoritm bitmask */
...@@ -373,6 +387,11 @@ void pid_exec( ...@@ -373,6 +387,11 @@ void pid_exec(
#define DALG 8 /* Derivative part exists */ #define DALG 8 /* Derivative part exists */
#define DAVV 16 /* Derivative part working on control difference */ #define DAVV 16 /* Derivative part working on control difference */
#define IWUP 1 /* Windup limitation on I part */
#define BIWUP 2 /* Windup limitation on Bias and I part */
#define BPIWUP 4 /* Windup limitation on Bias PI part */
#define BPIDWUP 8 /* Windup limitation on Bias and PID part (Default, old funcionality */
float xold; /* Local variables */ float xold; /* Local variables */
float eold; float eold;
float bfold; float bfold;
...@@ -381,6 +400,8 @@ void pid_exec( ...@@ -381,6 +400,8 @@ void pid_exec(
float ut; float ut;
float dut; float dut;
float kd; float kd;
float absut;
float gain;
/* Save old values */ /* Save old values */
xold=object->ProcVal; xold=object->ProcVal;
...@@ -402,73 +423,93 @@ object->ControlDiff = object->ProcVal - object->SetVal; ...@@ -402,73 +423,93 @@ object->ControlDiff = object->ProcVal - object->SetVal;
ddiff = ((object->PidAlg & DAVV) != 0) ? ddiff = ((object->PidAlg & DAVV) != 0) ?
(object->ControlDiff - eold) / *object->ScanTime: (object->ControlDiff - eold) / *object->ScanTime:
(object->ProcVal - xold) / *object->ScanTime; (object->ProcVal - xold) / *object->ScanTime;
if ((object->DerGain <= 0.0) || (object->DerTime <= 0)) if (((object->DerGain * *object->ScanTime) >= object->DerTime) || (object->DerTime <= 0))
object->FiltDer = ddiff; /* No Filter */ object->FiltDer = ddiff; /* No Filter */
else { else {
kd = 1.0 / (1.0 + object->DerGain * *object->ScanTime / object->DerTime); kd = 1.0 / (1.0 + object->DerGain * *object->ScanTime / object->DerTime);
object->FiltDer += (ddiff - derold) * (1.0 - kd); object->FiltDer += (ddiff - derold) * (1.0 - kd);
} }
if (object->Inverse == 0) gain = object->Gain;
else gain = -object->Gain;
if ( object->Force ) if ( object->Force )
/* Force */ /* Force */
{ {
dut = object->OutVal; object->OutChange = object->ForcVal - object->OutVal;
object->OutVal = object->ForcVal; object->OutVal = object->OutWindup = object->ForcVal;
object->OutChange = object->OutVal - dut;
object->EndMin = FALSE; object->EndMin = FALSE;
object->EndMax = FALSE; object->EndMax = FALSE;
/* Adjust for bumpless transfer to auto */
object->PDManOffset = object->OutVal -
gain * object->ControlDiff - object->BiasGain * object->Bias;
if ((object->PidAlg & IALG) != 0) object->AbsOut = 0.0;
else object->AbsOut = object->OutVal;
if (object->WindupMask < BIWUP)
object->OutWindup -= object->BiasGain * object->Bias;
if (object->WindupMask < BPIWUP)
object->OutWindup -= gain * object->ControlDiff;
object->AbsOut = object->OutVal - object->OutWindup;
} }
else else
/* Auto mode */ /* Auto mode */
{ {
dut = absut = 0.0;
if ((object->PidAlg & IALG) != 0) if ((object->PidAlg & IALG) != 0)
/* Incremental algorithm */ /* Incremental algorithm */
{ {
/* Integral-part */ /* Integral-part */
if ((*object->IntOffP == FALSE) && (object->IntTime > 0)) if ((*object->IntOffP == FALSE) && (object->IntTime > 0))
dut = object->ControlDiff * *object->ScanTime / object->IntTime; dut = object->ControlDiff * *object->ScanTime / object->IntTime;
else
dut = 0; if ((object->PidAlg & PALG) != 0) dut *= gain;
if ((object->PidAlg & PALG) != 0) else gain = 0.0; /* Pure I-controller */
/* Not pure I-controller */
{ /* Bias */
/* Derivative-part */ if (object->WindupMask >= BIWUP) /* Windup on Bias */
if ((object->PidAlg & DALG) != 0) dut += object->BiasGain * (object->Bias - bfold);
dut += (object->FiltDer-derold) * object->DerTime; else absut = object->BiasGain * object->Bias;
/* P-part */
/* P-part */
if (object->WindupMask >= BPIWUP) /* Windup on P */
dut += ((object->PidAlg & PAVV) != 0) ? dut += ((object->PidAlg & PAVV) != 0) ?
object->ControlDiff - eold : gain * (object->ControlDiff - eold) :
object->ProcVal - xold ; gain * (object->ProcVal - xold) ;
dut *= object->Gain; else
absut += gain * object->ControlDiff;
/* Derivative-part */
if ((object->PidAlg & DALG) != 0) {
if (object->WindupMask >= BPIDWUP) /* Windup on D */
dut += gain * (object->FiltDer - derold) * object->DerTime;
else
absut += gain * object->FiltDer * object->DerTime;
} }
if (object->Inverse != 0) dut = - dut;
/* Bias */
dut += object->BiasGain * (object->Bias - bfold);
/* Limit output */ /* Limit output */
ut = object->OutVal + dut; object->OutWindup += dut;
if (object->MaxOut > object->MinOut)
{ if (object->OutWindup > object->MaxWindup) {
if (ut > object->MaxOut) object->OutWindup = object->MaxWindup;
{ object->EndMax = TRUE;
ut = object->MaxOut; } else if (object->OutWindup < object->MinWindup) {
object->EndMin = FALSE; object->OutWindup = object->MinWindup;
object->EndMax = TRUE; object->EndMin = TRUE;
}
else if (ut < object->MinOut)
{
ut = object->MinOut;
object->EndMin = TRUE;
object->EndMax = FALSE;
}
else
{
if (object->EndMin && (ut >= (object->MinOut + object->EndHys)))
object->EndMin = FALSE;
if (object->EndMax && (ut <= (object->MaxOut - object->EndHys)))
object->EndMax = FALSE;
}
} }
ut = object->OutWindup + absut;
if (ut > object->MaxOut) ut = object->MaxOut;
else if (ut < object->MinOut) ut = object->MinOut;
dut += absut - object->AbsOut;
} }
else else
...@@ -480,39 +521,27 @@ else ...@@ -480,39 +521,27 @@ else
if ((object->PidAlg & DALG) != 0) if ((object->PidAlg & DALG) != 0)
ut += object->FiltDer * object->DerTime; ut += object->FiltDer * object->DerTime;
/* Gain */ /* Gain */
ut *= object->Gain; ut *= gain;
if (object->Inverse != 0) ut = - ut;
/* Bias */ /* Bias and Man offset */
ut += object->BiasGain * object->Bias; if (object->PDAbsFlag) object->PDManOffset = 0;
ut += object->BiasGain * object->Bias + object->PDManOffset;
/* Limit output */ /* Limit output */
if (object->MaxOut > object->MinOut) if (object->MaxOut > object->MinOut)
{ {
if (ut > object->MaxOut) if (ut > object->MaxOut) ut = object->MaxOut;
{ else if (ut < object->MinOut) ut = object->MinOut;
ut = object->MaxOut;
object->EndMin = FALSE;
object->EndMax = TRUE;
}
else if (ut < object->MinOut)
{
ut = object->MinOut;
object->EndMin = TRUE;
object->EndMax = FALSE;
}
else
{
if (object->EndMin && (ut >= (object->MinOut + object->EndHys)))
object->EndMin = FALSE;
if (object->EndMax && (ut <= (object->MaxOut - object->EndHys)))
object->EndMax = FALSE;
}
} }
dut = ut - object->OutVal; dut = ut - object->OutVal;
absut = ut;
} }
/* Output Auto */ /* Output Auto */
object->OutChange = dut; object->OutChange = dut;
object->OutVal = ut; object->OutVal = ut;
object->AbsOut = absut;
} }
} }
...@@ -52,7 +52,8 @@ SObject pwrb:Class ...@@ -52,7 +52,8 @@ SObject pwrb:Class
! The input signal OutChange is regarded as a control ! The input signal OutChange is regarded as a control
! error. This error is transformed into a time by ! error. This error is transformed into a time by
! multiplication with Gain. The product is added to ! multiplication with Gain. The product is added to
! accumulator Acc. ! accumulator Acc. The absolute value of Acc is limited
! to MaxWindup.
! !
! If the absolute value of Acc > MinTim either the output ! If the absolute value of Acc > MinTim either the output
! Open or Close is set. If Acc > MinTim an incremental ! Open or Close is set. If Acc > MinTim an incremental
...@@ -193,6 +194,18 @@ SObject pwrb:Class ...@@ -193,6 +194,18 @@ SObject pwrb:Class
Attr GraphName = "MaxTim" Attr GraphName = "MaxTim"
EndBody EndBody
EndObject EndObject
!/**
! Maximum windup in seconds
! The absolute value of Acc will never be greater than MaxWindup
! Typically less or equal than running time from open to closed
! Default 30 seconds. Lessor equal to zero means no limitation.
!*/
Object MaxWindup $Intern 19
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "MaxWindup"
EndBody
EndObject
Object OpenP $Intern 8 Object OpenP $Intern 8
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_POINTER Attr Flags |= PWR_MASK_POINTER
...@@ -387,6 +400,7 @@ SObject pwrb:Class ...@@ -387,6 +400,7 @@ SObject pwrb:Class
Object Template Inc3P Object Template Inc3P
Body RtBody Body RtBody
Attr Gain = 1.0 Attr Gain = 1.0
Attr MaxWindup = 30.0
EndBody EndBody
EndObject EndObject
EndObject EndObject
......
...@@ -175,8 +175,6 @@ SObject pwrb:Class ...@@ -175,8 +175,6 @@ SObject pwrb:Class
Object SetVal $Output 7 Object SetVal $Output 7
Body SysBody Body SysBody
Attr PgmName = "SetVal" Attr PgmName = "SetVal"
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SV" Attr GraphName = "SV"
EndBody EndBody
...@@ -380,16 +378,26 @@ SObject pwrb:Class ...@@ -380,16 +378,26 @@ SObject pwrb:Class
! Mode object display. The values may be changed in the ! Mode object display. The values may be changed in the
! more info form of the Mode object. ! more info form of the Mode object.
!*/ !*/
Object SetMinShow $Intern 21
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMinShow"
EndBody
EndObject
Object SetMaxShow $Intern 20 Object SetMaxShow $Intern 20
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMaxShow" Attr GraphName = "SetMaxShow"
EndBody EndBody
EndObject EndObject
Object SetMinShow $Intern 21 !/**
! Specifies the engineering unit of XSetVal / SetVal / SetMinShow /
! SetMaxShow, e.g. kg. Used in the Mode object display.
!*/
Object SetEngUnit $Intern 24
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$String16"
Attr GraphName = "SetMinShow" Attr GraphName = "SetEngUnit"
EndBody EndBody
EndObject EndObject
!/** !/**
...@@ -398,32 +406,22 @@ SObject pwrb:Class ...@@ -398,32 +406,22 @@ SObject pwrb:Class
! object in the Mode display. The values may be changed ! object in the Mode display. The values may be changed
! in the more info form of the Mode object. ! in the more info form of the Mode object.
!*/ !*/
Object OutMaxShow $Intern 22
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMaxShow"
EndBody
EndObject
Object OutMinShow $Intern 23 Object OutMinShow $Intern 23
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMinShow" Attr GraphName = "OutMinShow"
EndBody EndBody
EndObject EndObject
!/** Object OutMaxShow $Intern 22
! Specifies the engineering unit of SetMinShow /
! SetMaxShow, e.g. kg. Used in the Mode object display.
! OutEngUnit
!*/
Object SetEngUnit $Intern 24
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$String16" Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetEngUnit" Attr GraphName = "OutMaxShow"
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the engineering unit of OutMinShow / ! Specifies the engineering unit of XForcVal / OutVal /
! OutMaxShow e.g. %. Used in the Mode object display. ! ForcVal / OutMinShow / OutMaxShow e.g. %.
! Used in the Mode object display.
!*/ !*/
Object OutEngUnit $Intern 25 Object OutEngUnit $Intern 25
Body SysBody Body SysBody
......
...@@ -70,10 +70,18 @@ SObject pwrb:Class ...@@ -70,10 +70,18 @@ SObject pwrb:Class
! the I-part will give a slope. ! the I-part will give a slope.
! I+P means that the P-part will only be affected by changes on the process value. ! I+P means that the P-part will only be affected by changes on the process value.
! !
! When using the P- or PD-algorithm we use an aabsolute algorithm. The output ! When using the P- or PD-algorithm we use an absolute algorithm. The output
! will not be stable away from zero without a control deviation. ! will not be stable away from zero without a control deviation.
! When using algorithms with I-part, all changesof the output are calculated by ! If PDAbsFlag is zero, there will be a offset that is calculated when the
! changes of the inputs to the controller. You can still turn off the integration ! controller is in manual mode (force), so that there is no jump in the output
! when going from manual to auto.
! When using algorithms with I-part, the output is divided in two parts, depending
! on the bitmask WindupMask. The I-part is always calculated and limited in the
! OutWindup, and you can select to include the Bias, the P-part and the D-part also.
! OutWindup is limited to MinWindup and MaxWindup, which sets the signals EndMin and EndMax
! The rest of the output is calculated as an absolute part in AbsOut, that is added to the
! OutWindup, and then limited to MinOutput and MaxOutput.
! You can still turn off the integration
! with an input to the object ! with an input to the object
! !
! The PID-object has two outputs. ! The PID-object has two outputs.
...@@ -95,21 +103,32 @@ SObject pwrb:Class ...@@ -95,21 +103,32 @@ SObject pwrb:Class
! !
! You can use a feedforward signal by the Bias-input, with BiasGain. ! You can use a feedforward signal by the Bias-input, with BiasGain.
! !
! The output, OutVal, is limited to the interval { MinOut , MaxOut }. This means ! The output from the controller is divided in two parts, OutWindup and AbsOut.
! The OutWindup contains the I-part and possibly the bias, P and D parts.
! Select by WindupMask between I, BI, BPI and BPID.
! OutWindup, is limited to the interval { MinWindup , MaxWindup }. This means
! that you can loose your stable controlpoint if you have much noise. Especially ! that you can loose your stable controlpoint if you have much noise. Especially
! if you use the D-part of the controller. The interval should normally be a bit ! if you use the D-part of the controller. If you set the flag WindupMask to BIP
! larger than the possible output to the process. ! you remove the influence of D from the OutWindup. You can also set it to BI or I to remove the
! influence of P and Bias from the OutWindup
! The total output is also limited to the interval {MinOut , MaxOut }
!
! Example: You have a rather noisy flowcontrol with an output 0-100% as ! Example: You have a rather noisy flowcontrol with an output 0-100% as
! speedreference to a pump. ! speedreference to a pump. WindupMask = BPID. MinWindup = 0, MaxWindup = 100.
! The output varies +- 5% as a result of the noise. At the moment we need 98% ! The output varies +- 5% as a result of the noise. At the moment we need 98%
! output as an average to reach the desired setpoint. If we use 100% as MaxOut ! output as an average to reach the desired setpoint. If we use 100% as MaxWindup
! for the controller, the output will be cut all the time, and it will vary ! for the controller, the output will be cut all the time, and it will vary
! between 90 and 100% with 95% as an average. We will not reach the setpoint. ! between 90 and 100% with 95% as an average. We will not reach the setpoint.
! The solution is to allow the output from -10% to 110%, and then limit the ! The solution is to change WindupMask to I or BI. The disturbances will not affect the windup,
! output outside the controller. ! but the output will still be limited to 0-100 %
!
! For a servo valve for position control, you may want to have a slow I-part for leakage control,
! but limited to +- 20 %. WindupMask = I or BI,
! Set MinWindup = -20, Max Windup = + 20, MinOutput = -100, Max Output = +100
! EndMin and EndMax can now be used to give alarm for leakage.
! !
! The controller has bumpless transfer between manual and auto, and after forced ! The controller has bumpless transfer between manual and auto, and after forced
! output, but not if you use the P or PD-form. ! output, but not if you use the P or PD-form with the flag PDAbsFlag.
! !
! !
! !
...@@ -142,13 +161,14 @@ SObject pwrb:Class ...@@ -142,13 +161,14 @@ SObject pwrb:Class
! PID (lower left) adds a short spike at the start, which in this case ! PID (lower left) adds a short spike at the start, which in this case
! doesn't affect anything. ! doesn't affect anything.
! MaxOut = 500% ! MaxOut = 500%
! PID (lower right) is identical with the left, except for MaxOut = 100%, ! PID (lower right) is identical with the left, except for MaxWindup = 100%,
! which gives "wrong" result. ! and WindupMask = BPID, which gives "wrong" result.
! At the setpoint step, the P-part gives an increase of 30 %, and the ! At the setpoint step, the P-part gives an increase of 30 %, and the
! P-part wants a spike of 90 %. That results in an output of 155%, which ! P-part wants a spike of 90 %. That results in an output of 155%, which
! is cut to 100% because of saturation of the output signal. Then the D-part ! is cut to 100% because of saturation of the output signal. Then the D-part
! will remove 90 % again, and the controller will restart from 10% output, ! will remove 90 % again, and the controller will restart from 10% output,
! which is not desired. ! which is not desired.
! Use WindupMask = BPI !!
! !
! !
! @h1 Examples ! @h1 Examples
...@@ -426,13 +446,13 @@ SObject pwrb:Class ...@@ -426,13 +446,13 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies if OutVal at this scanning has been limited ! Specifies if OutWindup at this scanning has been limited
! against any of the limit values in the interval { ! against any of the limit values in the interval {
! MinOut, MaxOut } or not. If a limitation is done ! MinWindup, MaxWindup } or not. If a limitation is done
! against ! against
! !
! -- MinOut, then EndMin is set TRUE ! -- MinWindup, then EndMin is set TRUE
! -- MaxOut, then EndMax is set TRUE ! -- MaxWindup, then EndMax is set TRUE
! else they are FALSE. ! else they are FALSE.
! !
! EndMin /EndMax can only be set in AUTO or CASCADE ! EndMin /EndMax can only be set in AUTO or CASCADE
...@@ -576,16 +596,60 @@ SObject pwrb:Class ...@@ -576,16 +596,60 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! At AUTO and CASCADE control the control signal OutVal ! Flag to force no offset after manual mode. Will cause an output jump
! is supposed to be in the interval { MinOut, MaxOut }. ! when switching from manual to Auto. Not Bumpless transfer!
!*/
Object PDAbsFlag $Intern 49
Body SysBody
Attr TypeRef = "pwrb:Type-Boolean"
Attr GraphName = "PDAbsFlag"
EndBody
EndObject
!/**
! WindupMask
! The possible values are as follows:
!
! 1 -- I Only the I-part is limited in OutWindup
!
! 2 -- BI Bias and I are limited in OutWindup
!
! 4 -- BPI Bias, P and I are limited in OutWindup
!
! 8 -- BPID All parts of the controller are limited in OutWindup
!*/
Object WindupMask $Intern 50
Body SysBody
Attr TypeRef = "pwrb:Type-WindupMaskEnum"
Attr GraphName = "WindupMask"
EndBody
EndObject
!/**
! At AUTO and CASCADE control for controllers with an I-part,
! the control signal OutWindup is supposed to be
! in the interval { MinWindup, MaxWindup }.
! The EndMin /EndMax flags are used to signal if any ! The EndMin /EndMax flags are used to signal if any
! limitation has occurred. ! limitation has occurred.
! If OutVal is greater than MaxOut or less than MinOut, ! If OutWindup is greater than MaxWindup or less than MinWindup,
! OutVal is limited to the value at the end of the ! OutWindup is limited to the value at the end of the
! interval. ! interval.
! If MinWindup >= MaxWindup no limitation will occur.
! !
! After addition of the absolute output part,
! OutVal is limited to the interval {MinOut , MaxOut }.
! If MinOut >= MaxOut no limitation will occur. ! If MinOut >= MaxOut no limitation will occur.
!*/ !*/
Object MinWindup $Intern 51
Body SysBody
Attr TypeRef = "pwrb:Type-Float32"
Attr GraphName = "MinWindup"
EndBody
EndObject
Object MaxWindup $Intern 52
Body SysBody
Attr TypeRef = "pwrb:Type-Float32"
Attr GraphName = "MaxWindup"
EndBody
EndObject
Object MinOut $Intern 19 Object MinOut $Intern 19
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
...@@ -599,6 +663,73 @@ SObject pwrb:Class ...@@ -599,6 +663,73 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the hysteresis on MinOut and MaxOut in
! connection with the handling of EndMin/EndMax.
! @image orm_en1-144.gif
!*/
Object EndHys $Intern 47
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "EndHys"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of ProcVal and SetVal in the Pid object
! display. The values may be changed in the more info
! form of the Pid object.
!*/
Object SetMinShow $Intern 41
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMinShow"
EndBody
EndObject
Object SetMaxShow $Intern 40
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMaxShow"
EndBody
EndObject
!/**
! Specifies the engineering unit of SetVal / SetMinShow /
! SetMaxShow, e.g. meter. Used in the Pid object display.
!*/
Object SetEngUnit $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$String16"
Attr GraphName = "SetEngUnit"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of the control signal OutVal in the Pid
! object display. The values may be changed in the more
! info form of the Pid object.
!*/
Object OutMinShow $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMinShow"
EndBody
EndObject
Object OutMaxShow $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMaxShow"
EndBody
EndObject
!/**
! Specifies the engineering unit of OutVal / Force / OutMinShow /
! OutMaxShow, e.g., %. Used in the Pid object display.
!*/
Object OutEngUnit $Intern 45
Body SysBody
Attr TypeRef = "pwrs:Type-$String16"
Attr GraphName = "OutEngUnit"
EndBody
EndObject
!/**
! Program cycle period in seconds, i.e. the sample time. ! Program cycle period in seconds, i.e. the sample time.
!*/ !*/
Object ScanTime $Intern 21 Object ScanTime $Intern 21
...@@ -758,63 +889,6 @@ SObject pwrb:Class ...@@ -758,63 +889,6 @@ SObject pwrb:Class
Attr GraphName = "MaxBGain" Attr GraphName = "MaxBGain"
EndBody EndBody
EndObject EndObject
Object SetMaxShow $Intern 40
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMaxShow"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of ProcVal and SetVal in the Pid object
! display. The values may be changed in the more info
! form of the Pid object.
!*/
Object SetMinShow $Intern 41
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "SetMinShow"
EndBody
EndObject
!/**
! The lower respectively upper limit in the graph at
! presentation of the control signal OutVal in the Pid
! object display. The values may be changed in the more
! info form of the Pid object.
!*/
Object OutMaxShow $Intern 42
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMaxShow"
EndBody
EndObject
Object OutMinShow $Intern 43
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "OutMinShow"
EndBody
EndObject
!/**
! Specifies the engineering unit of SetMinShow /
! SetMaxShow, e.g. meter. Used in the Pid object display.
!*/
Object SetEngUnit $Intern 44
Body SysBody
Attr TypeRef = "pwrs:Type-$String16"
Attr GraphName = "SetEngUnit"
EndBody
EndObject
!/**
! Specifies the engineering unit of OutMinShow /
! OutMaxShow, e.g., %. Used in the in the Pid object
! display.
!*/
Object OutEngUnit $Intern 45
Body SysBody
Attr TypeRef = "pwrs:Type-$String16"
Attr GraphName = "OutEngUnit"
EndBody
EndObject
!/** !/**
! Specifies the complete name of the Mode object ! Specifies the complete name of the Mode object
! associated to this Pid object. The attribute makes it ! associated to this Pid object. The attribute makes it
...@@ -829,27 +903,52 @@ SObject pwrb:Class ...@@ -829,27 +903,52 @@ SObject pwrb:Class
EndBody EndBody
EndObject EndObject
!/** !/**
! Specifies the hysteresis on MinOut and MaxOut in ! Filtered derivative is saved to the next program cycle.
! connection with the handling of EndMin/EndMax.
! @image orm_en1-144.gif
!*/ !*/
Object EndHys $Intern 47 Object FiltDer $Intern 48
Body SysBody Body SysBody
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
Attr TypeRef = "pwrs:Type-$Float32" Attr TypeRef = "pwrs:Type-$Float32"
Attr GraphName = "EndHys" Attr GraphName = "FiltDer"
EndBody EndBody
EndObject EndObject
!/** !/**
! Filtered derivative is saved to the next program cycle. ! Offset for PD-controller when switching from manual to auto mode
!*/ !*/
Object FiltDer $Intern 48 Object PDManOffset $Intern 53
Body SysBody Body SysBody
Attr TypeRef = "pwrb:Type-Float32"
Attr GraphName = "PDManOffset"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject
!/**
! Output that is cut off (limited) with MinWindup and MaxWindup
!*/
Object OutWindup $Intern 54
Body SysBody
Attr TypeRef = "pwrb:Type-Float32"
Attr GraphName = "OutWindup"
Attr Flags |= PWR_MASK_INVISIBLE Attr Flags |= PWR_MASK_INVISIBLE
Attr TypeRef = "pwrs:Type-$Float32" Attr Flags |= PWR_MASK_STATE
Attr GraphName = "FiltDer" Attr Flags |= PWR_MASK_NOEDIT
EndBody EndBody
EndObject
!/**
! The absolute part of the output. (Contrary to OutWindup)
!*/
Object AbsOut $Intern 55
Body SysBody
Attr TypeRef = "pwrb:Type-Float32"
Attr GraphName = "AbsOut"
Attr Flags |= PWR_MASK_INVISIBLE
Attr Flags |= PWR_MASK_STATE
Attr Flags |= PWR_MASK_NOEDIT
EndBody
EndObject EndObject
EndObject EndObject
Object DevBody $ObjBodyDef 2 Object DevBody $ObjBodyDef 2
...@@ -907,6 +1006,8 @@ SObject pwrb:Class ...@@ -907,6 +1006,8 @@ SObject pwrb:Class
Attr SetMaxShow = 100.0 Attr SetMaxShow = 100.0
Attr SetEngUnit = "%" Attr SetEngUnit = "%"
Attr OutEngUnit = "%" Attr OutEngUnit = "%"
Attr WindupMask = 4
Attr MaxWindup = 100.0
EndBody EndBody
EndObject EndObject
EndObject EndObject
......
...@@ -7509,14 +7509,15 @@ satta under en tid som ...@@ -7509,14 +7509,15 @@ satta under en tid som
@image orm_en1-100.gif @image orm_en1-100.gif
Insignalen OutChange betraktas som ett reglerfel. Detta fel överförs till en tid Insignalen OutChange betraktas som ett reglerfel. Detta fel överförs till en tid
genom multiplikation med Gain . Produkten adderas till ackumulatorn Acc . genom multiplikation med Gain . Produkten adderas till ackumulatorn Acc.
Absolutvärdet av Acc begränsas till MaxWindup.
Om absolut värdet av Acc är större än MinTim sätts någon av utgångarna Open Om absolut värdet av Acc är större än MinTim sätts någon av utgångarna Open
eller Close till TRUE. eller Close till TRUE.
Om Acc > MinTim sätts 'öka' signalen (= Open ) så länge som Acc = 0 , om, å Om Acc > MinTim sätts 'öka' signalen (= Open ) så länge som Acc > 0 , om, å
andra sidan, Acc < - MinTim sätts 'minska' signalen (= Close ) så länge som andra sidan, Acc < - MinTim sätts 'minska' signalen (= Close ) så länge som
Acc = 0. Vid varje exekvering räknas värdet av Acc ned respektive upp med ett Acc < 0. Vid varje exekvering räknas värdet av Acc ned respektive upp med ett
tidsbelopp av ScanTime , beroende på om 'öka' eller 'minska' signalen satts. tidsbelopp av ScanTime , beroende på om 'öka' eller 'minska' signalen satts.
För att undvika 'obefogade' styringrepp, som skulle kunna skada ställdon vid För att undvika 'obefogade' styringrepp, som skulle kunna skada ställdon vid
...@@ -7608,6 +7609,12 @@ Ackumulerad styrsignal - ingrepp i form av tid. ...@@ -7608,6 +7609,12 @@ Ackumulerad styrsignal - ingrepp i form av tid.
Ackumulerad löptid utan ingrepp. Ackumulerad löptid utan ingrepp.
</attr> </attr>
<attr>MaxWindup
Absolutvärdet av Acc begränsas till MaxWindupsekunder, för att undvika oändlig
uppvridning vid felsatta parametrar. Negativt eller noll ger ingen begränsning.
Bör vara nära gångtid från helt stängd till helt öppen. Default 30 sek.
</attr>
<attr>TimerFlag <attr>TimerFlag
Markerar aktiv timer. Markerar aktiv timer.
</attr> </attr>
...@@ -8922,13 +8929,13 @@ objektets objektbild. Gr ...@@ -8922,13 +8929,13 @@ objektets objektbild. Gr
</attr> </attr>
<attr>SetEngUnit <attr>SetEngUnit
Anger ingenjörsenheten för SetMinShow / SetMaxShow , t.ex kg. Används i Anger ingenjörsenheten för XSetVal / SetVal / SetMinShow / SetMaxShow, t.ex kg.
Mode-objektets objektbild. Används i Mode-objektets objektbild.
</attr> </attr>
<attr>OutEngUnit <attr>OutEngUnit
Anger ingenjörsenheten för OutMinShow / OutMaxShow , t.ex %. Används i Anger ingenjörsenheten för XForcVal / OutVal /ForcVal / OutMinShow / OutMaxShow, t.ex %.
Mode-objektets objektbild. Används i Mode-objektets objektbild.
</attr> </attr>
<attr>PidObjDid <attr>PidObjDid
...@@ -10361,10 +10368,14 @@ bara genom att det st ...@@ -10361,10 +10368,14 @@ bara genom att det st
Vid P- och PD-algoritm används en absolut algoritm. Utsignalen kan då alltså inte Vid P- och PD-algoritm används en absolut algoritm. Utsignalen kan då alltså inte
ligga stabilt skilt från noll utan regleravvikelse, annat än om man använder en ligga stabilt skilt från noll utan regleravvikelse, annat än om man använder en
framkopplingssignal. framkopplingssignal. Om flaggan PDAbsFlag sitter, så beräknas en offset i manuell mod,
Vid alla algoritmer med I-del baseras hela tiden förändringar i utsignalen på så att vi får en stötfri övergång till auto.
förändringar i insignalerna. Man kan fortfarande stänga av integrereringen med Vid alla algoritmer med I-del delas utsignalen upp i två delar ned hjälp av masken WindupMask.
en insignal till objektet. I-delen ingår alltid i OutWindup, medanBias, P-delen och D-delen kan tillhöra antingen OutWindup
eller AbsOut.
OutWindup begränsas av MinWindup och MaxWindup, vilket sätter flaggorna EndMin och EndMax.
Resten av utsignalen lagras i AbsOut, och total utsignal begränsas med MinOut och MaxOut
Man kan även stänga av integrereringen med en insignal till objektet.
Pid-objektet har två utgångar som båda kan användas som styrsignal. Vilken som Pid-objektet har två utgångar som båda kan användas som styrsignal. Vilken som
används i det enskilda fallet beror på hur regleringen är ordnad: används i det enskilda fallet beror på hur regleringen är ordnad:
...@@ -10388,25 +10399,35 @@ s ...@@ -10388,25 +10399,35 @@ s
skulle bli utan filtrering. skulle bli utan filtrering.
En framkopplingssignal, Bias, kan inkluderas i algoritmen genom en ingångssignal En framkopplingssignal, Bias, kan inkluderas i algoritmen genom en ingångssignal
till objektet. till objektet. Förstärkning framkoppling anges med BiasGain.
Utvärdet, OutVal, begränsas till intervallet { MinOut, MaxOut }. Det innebär att Regulatorns utsignal OutVal är uppdelad i två delar, OutWindup och AbsOut.
I-delen innefattas alltid i OutWindup. Med WindupMask kan man styra även Bias,
P-delen och D-delen till OutWindup.
OutWindup, begränsas till intervallet { MinWindup, MaxWindup }. Det innebär att
man kan tappa det stabila läget vid en orolig reglering, speciellt vid inkopplad man kan tappa det stabila läget vid en orolig reglering, speciellt vid inkopplad
D-del. D-del. Om man sätter flaggan WindupMask till BIP, så tar man bort D-delens inflytande
på OutWindup. Man kan även sätta den till BI eller I för att ta bort P-delen och
Bias från OutWindup.
Den totala utsignalen OutVal begränsas till intervallet { MinOut , MaxOut }.
Exempel: Vi har en ganska orolig flödesreglering (utsignal 0-100 %) och reglerar Exempel: Vi har en ganska orolig flödesreglering (utsignal 0-100 %) och reglerar
nära maxvarvet för pumpen. Vi behöver styra ut i snitt 98 % för att nå önskat nära maxvarvet för pumpen. WindupMask = BPID. Vi behöver styra ut i snitt 98 % för
börvärde. Utsignalen fladdrar ca +- 5 % pga störningar. Om MaxOut är 100 %, så att nå önskat börvärde. Utsignalen fladdrar ca +- 5 % pga störningar.
innebär det att regulatorn bottnar regelbundet. Utsignalen kommer då att svänga Om MaxWindup är 100 %, så innebär det att regulatorn bottnar regelbundet. Utsignalen
mellan 90 och 100 % med en medelutsignal på ca 95%, och vi når inte önskat kommer då att svänga mellan 90 och 100 % med en medelutsignal på ca 95%, och vi når inte önskat
börvärde. börvärde.
Lösning: Sätt MinOut och MaxOut till -10 % resp 110 %. Utsignalen kommer att Lösning: Sätt WindupMask till I eller BI. Störningarna kommer inte att påverka MaxWindup.
svänga mellan 93 och 103% med ett medel på 98%, och vi uppnår önskat börvärde.
Utsignalen får sedan begränsas till 0 - 100 % utanför PID-regulatorn. För en servoventil med positionsreglering, kan man vilja ha en långsam I-del för läckagekontroll,
begränsad till +- 20 %. Sätt WindupMask till I eller BI.
Sätt MinWindup = -20% och MaxWindup till +20%, MinOutput = -100 %, MaxOutput = 100 %
EndMin och EndMax kan användas för läckagelarm.
Regulatorn har stötfri omkoppling AUTO / MANUAL och efter annan tvångsstyrning av Regulatorn har stötfri omkoppling AUTO / MANUAL och efter annan tvångsstyrning av
regulatorn. regulatorn.
Dock ej vid P- eller PD-reglering. Dock ej vid P- eller PD-reglering, om man har PDAbsFlag satt.
EXEMPEL 1 EXEMPEL 1
...@@ -10638,8 +10659,8 @@ operat ...@@ -10638,8 +10659,8 @@ operat
</attr> </attr>
<attr>OutChange <attr>OutChange
Regulatorns syrsignal baserad på 'incremental form'. Regulatorns syrsignal baserad på 'incremental form', eller förändring i styrsignalen
vid 'positional form'.
Attributet avser styrsignalsförändringen mellan två konsekutiva exekveringar; Attributet avser styrsignalsförändringen mellan två konsekutiva exekveringar;
dvs. OutVal t - OutVal t-1 . dvs. OutVal t - OutVal t-1 .
</attr> </attr>
...@@ -10649,14 +10670,14 @@ Reglerfelet (= ProcVal - SetVal ). ...@@ -10649,14 +10670,14 @@ Reglerfelet (= ProcVal - SetVal ).
</attr> </attr>
<attr>EndMin <attr>EndMin
Om beräknat värde på OutVal inte tillhör intervallet { MinOut , MaxOut } ska Om beräknat värde på OutWindup inte tillhör intervallet { MinWindup , MaxWindup } ska
begränsning ske till motsvarande intervallgräns. Attributet anger om sådan begränsning ske till motsvarande intervallgräns. Attributet anger om sådan
begränsning skett vid den senaste exekveringen eller ej. begränsning skett vid den senaste exekveringen eller ej.
Om begränsning görs mot Om begränsning görs mot
-- MinOut , ska EndMin sättas TRUE -- MinWindup , ska EndMin sättas TRUE
-- MaxOut , ska EndMax sättas TRUE -- MaxWindup , ska EndMax sättas TRUE
annars är de FALSE. annars är de FALSE.
...@@ -10748,11 +10769,10 @@ V ...@@ -10748,11 +10769,10 @@ V
<attr>MinOut <attr>MinOut
I driftläge AUTO och CASCADE ska den utställda styrsignlaen OutVal vara i I driftläge AUTO och CASCADE ska den utställda styrsignlaen OutVal vara i
intervallet { MinOut , MaxOut }. Flaggorna EndMin / EndMax används för att intervallet { MinOut , MaxOut }.
signalera då begränsning sker.
Om OutVal är större än MaxOut eller mindre än MinOut , begränsas OutVal Om OutVal är större än MaxOut eller mindre än MinOut , begränsas OutVal
till värdet av motsvarande intervallgräns. till värdet av motsvarande intervallgräns.
Om MinOut = MaxOut sker ingen begränsning. Om MinOut >= MaxOut sker ingen begränsning.
</attr> </attr>
<attr>MaxOut <attr>MaxOut
...@@ -10909,6 +10929,45 @@ EndMin / EndMax flaggorna. ...@@ -10909,6 +10929,45 @@ EndMin / EndMax flaggorna.
Filtrerad derivata sparas till nästa exekevering. Filtrerad derivata sparas till nästa exekevering.
</attr> </attr>
<attr>PDAbsFlag
Anger att utsignalen beräknas direkt med regleravvikelsen.
Vid nollvärde beräknas en offset i manuell mod, så att vi får stötfri övergång till auto.
</attr>
<attr>WindupMask
Möjliga värden är:
1 -- I Bara I-delen begränsas i OutWindup
2 -- BI I-delen och Bias begränsas i OutWindup
4 -- BIP Också P-delen begränsas i OutWindup
8 -- BIPD Hela utsignalen, även D-delen begränsas i OutWindup
</attr>
<attr>MinWindup
I driftläge AUTO och CASCADE ska den utställda styrsignalen OutWindup vara i
intervallet { MinWindup , MaxWindup }. Flaggorna EndMin / EndMax används för att
signalera då begränsning sker.
Om OutWindup är större än MaxWindup eller mindre än MinWindup , begränsas OutWindup
till värdet av motsvarande intervallgräns.
Om MinWindup >= MaxWindup sker ingen begränsning.
</attr>
<attr>MaxWindup
Se MinOut
</attr>
<attr>PDManOffset
Offset beräknas i manuell mod, och används vid P och PD-algoritm
för att få stötfri övergång till auto.
</attr>
<attr>OutWindup
Utsignal som begränsas av MinWindup och MaxWindup
</attr>
<attr>AbsOut
Utsignaldel som ligger utanför OutWindup
</attr>
<attr>OpMod <attr>OpMod
OpMod = MANUAL (=1) OpMod = MANUAL (=1)
Då Mode-objektets for-utgång blir TRUE tvingas Pid-objekt utgång Då Mode-objektets for-utgång blir TRUE tvingas Pid-objekt utgång
......
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program is free software; you can redistribute it and/or
! modify it under the terms of the GNU General Public License as
! published by the Free Software Foundation, either version 2 of
! the License, or (at your option) any later version.
!
! This program is distributed in the hope that it will be useful
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_windupmaskenum.wb_load -- Defines the mask type WindupMaskEnum
!
SObject pwrb:Type
!/**
! @Version 1.0
! @Group Types
! Enumeration for PID WindupMask.
!
! @b See also
! @classlink PID pwrb_pid.html
!*/
Object WindupMaskEnum $TypeDef 75
Body SysBody
Attr TypeRef = "pwrs:Type-$Enum"
Attr PgmName = "WindupMaskEnum"
EndBody
!/**
! Integral part only
!*/
Object IWUP $Value
Body SysBody
Attr PgmName = "IWUP"
Attr Text = "I"
Attr Value = 1
EndBody
EndObject
!/**
! Bias and Integral part
!*/
Object BIWUP $Value
Body SysBody
Attr PgmName = "BIWUP"
Attr Text = "BI"
Attr Value = 2
EndBody
EndObject
!/**
! Bias, Integral and Proportional part
!*/
Object BPIWUP $Value
Body SysBody
Attr PgmName = "BPIWUP"
Attr Text = "BPI"
Attr Value = 4
EndBody
EndObject
!/**
! All parts of the controller are limited in OutWindup
!*/
Object BPIDWUP $Value
Body SysBody
Attr PgmName = "BPIDWUP"
Attr Text = "BPID"
Attr Value = 8
EndBody
EndObject
EndObject
EndSObject
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment