Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
f92af1be
Commit
f92af1be
authored
May 22, 2006
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
707d86c7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19143 additions
and
3 deletions
+19143
-3
bcomp/changelog.txt
bcomp/changelog.txt
+3
-1
bcomp/lib/rt/src/rt_plc_bcomp.c
bcomp/lib/rt/src/rt_plc_bcomp.c
+252
-1
bcomp/mmi/bcomp/src/pwr_c_compmodepid.pwg
bcomp/mmi/bcomp/src/pwr_c_compmodepid.pwg
+6977
-0
bcomp/mmi/bcomp/src/pwr_c_comppid.pwg
bcomp/mmi/bcomp/src/pwr_c_comppid.pwg
+11909
-0
xtt/changelog.txt
xtt/changelog.txt
+2
-1
No files found.
bcomp/changelog.txt
View file @
f92af1be
060227 cs - Changelog created.
060509 cs bcomp Attribute DisableAlarm added to CompLimit to make it possible to use
the limit supervision in BaseSensor without alarm.
\ No newline at end of file
the limit supervision in BaseSensor without alarm.
060522 cs bcomp New classes CompPID and CompModePID: PID controller divided in main object
and function object.
\ No newline at end of file
bcomp/lib/rt/src/rt_plc_bcomp.c
View file @
f92af1be
/*
* Proview $Id: rt_plc_bcomp.c,v 1.
1 2006-01-12 07:38:08
claes Exp $
* Proview $Id: rt_plc_bcomp.c,v 1.
2 2006-05-22 13:27:23
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -114,7 +114,258 @@ void RunTimeCounterFo_exec( plc_sThread *tp,
o
->
OldReset
=
*
o
->
ResetP
;
}
/*_*
CompModePID_Fo
@aref compmodepid_fo CompModePID_Fo
*/
void
CompModePID_Fo_init
(
pwr_sClass_CompModePID_Fo
*
o
)
{
pwr_tDlid
dlid
;
pwr_tStatus
sts
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
o
->
PlcConnect
,
(
void
**
)
&
o
->
PlcConnectP
,
&
dlid
);
if
(
EVEN
(
sts
))
o
->
PlcConnectP
=
0
;
}
void
CompModePID_Fo_exec
(
plc_sThread
*
tp
,
pwr_sClass_CompModePID_Fo
*
o
)
{
pwr_sClass_CompModePID
*
co
=
(
pwr_sClass_CompModePID
*
)
o
->
PlcConnectP
;
if
(
!
co
)
return
;
/* Get indata */
co
->
ProcVal
=
*
o
->
ProcValP
;
co
->
XSetVal
=
*
o
->
XSetValP
;
if
(
o
->
XForcValP
!=
&
o
->
XForcVal
)
co
->
XForcVal
=
*
o
->
XForcValP
;
co
->
Forc1
=
*
o
->
Forc1P
;
co
->
Forc2
=
*
o
->
Forc2P
;
co
->
OutVal
=
*
o
->
OutValP
;
/* Make appropriate actions, depending on actual mode */
/* Manual */
if
(
co
->
OpMod
<=
1
)
{
co
->
Force
=
TRUE
;
co
->
ManMode
=
TRUE
;
co
->
AutMode
=
FALSE
;
co
->
CascMod
=
FALSE
;
/* External setpoint ? */
if
((
co
->
AccMod
&
2
)
==
0
)
co
->
SetVal
=
co
->
XSetVal
;
/* Test if Force in manual mode */
if
(
co
->
Forc1
)
co
->
ForcVal
=
co
->
XForcVal
;
}
else
{
/* Not Manual Mode */
if
(
co
->
OpMod
==
2
)
{
/* Auto */
co
->
ManMode
=
FALSE
;
co
->
AutMode
=
TRUE
;
co
->
CascMod
=
FALSE
;
}
else
{
/* Cascade mode */
co
->
ManMode
=
FALSE
;
co
->
AutMode
=
FALSE
;
co
->
CascMod
=
TRUE
;
co
->
SetVal
=
o
->
SetVal
=
co
->
XSetVal
;
}
/* Test if force in Auto or Cascade */
if
(
co
->
Forc1
||
co
->
Forc2
)
{
co
->
Force
=
TRUE
;
co
->
ForcVal
=
co
->
XForcVal
;
}
else
{
co
->
Force
=
FALSE
;
co
->
ForcVal
=
co
->
OutVal
;
}
}
/* Transfer to outputs */
o
->
SetVal
=
co
->
SetVal
;
o
->
ForcVal
=
co
->
ForcVal
;
o
->
Force
=
co
->
Force
;
o
->
AutMode
=
co
->
AutMode
;
o
->
CascMod
=
co
->
CascMod
;
}
/*_*
CompPID_Fo
@aref comppid_fo CompPID_Fo
*/
void
CompPID_Fo_init
(
pwr_sClass_CompPID_Fo
*
o
)
{
pwr_tDlid
dlid
;
pwr_tStatus
sts
;
sts
=
gdh_DLRefObjectInfoAttrref
(
&
o
->
PlcConnect
,
(
void
**
)
&
o
->
PlcConnectP
,
&
dlid
);
if
(
EVEN
(
sts
))
o
->
PlcConnectP
=
0
;
}
/* Define Algoritm bitmask */
#define IALG 1
/* Integral part -> Incremental algorithm */
#define PALG 2
/* Proportional part exists */
#define PAVV 4
/* Proportional part working on control difference */
#define DALG 8
/* Derivative part exists */
#define DAVV 16
/* Derivative part working on control difference */
void
CompPID_Fo_exec
(
plc_sThread
*
tp
,
pwr_sClass_CompPID_Fo
*
o
)
{
float
xold
;
/* Local variables */
float
eold
;
float
bfold
;
float
ddiff
;
float
derold
;
float
ut
;
float
dut
;
pwr_sClass_CompPID
*
co
=
(
pwr_sClass_CompPID
*
)
o
->
PlcConnectP
;
if
(
!
co
)
return
;
/* Save old values */
xold
=
co
->
ProcVal
;
eold
=
co
->
ControlDiff
;
bfold
=
co
->
Bias
;
derold
=
co
->
FiltDer
;
/* Get Input */
co
->
ProcVal
=
*
o
->
ProcValP
;
if
(
o
->
SetValP
!=
&
o
->
SetVal
)
co
->
SetVal
=
*
o
->
SetValP
;
if
(
o
->
ForcValP
!=
&
o
->
ForcVal
)
co
->
ForcVal
=
*
o
->
ForcValP
;
if
(
o
->
BiasP
!=
&
o
->
Bias
)
co
->
Bias
=
*
o
->
BiasP
;
if
(
o
->
ForceP
!=
&
o
->
Force
)
co
->
Force
=
*
o
->
ForceP
;
if
(
o
->
IntOffP
!=
&
o
->
IntOff
)
co
->
IntOff
=
*
o
->
IntOffP
;
else
o
->
IntOff
=
co
->
IntOff
;
/* Calculate Controller Error and Filtered derivate */
co
->
ControlDiff
=
co
->
ProcVal
-
co
->
SetVal
;
ddiff
=
((
co
->
PidAlg
&
DAVV
)
!=
0
)
?
(
co
->
ControlDiff
-
eold
)
/
*
o
->
ScanTime
:
(
co
->
ProcVal
-
xold
)
/
*
o
->
ScanTime
;
if
((
co
->
DerGain
<
1
.
0
)
||
(
co
->
DerGain
*
*
o
->
ScanTime
>=
co
->
DerTime
))
co
->
FiltDer
=
ddiff
*
co
->
DerTime
;
/* No Filter */
else
co
->
FiltDer
+=
(
ddiff
-
derold
)
*
co
->
DerGain
*
*
o
->
ScanTime
;
/* Filter */
if
(
co
->
Force
)
{
/* Force */
dut
=
co
->
OutVal
;
co
->
OutVal
=
co
->
ForcVal
;
co
->
OutChange
=
co
->
OutVal
-
dut
;
co
->
EndMin
=
FALSE
;
co
->
EndMax
=
FALSE
;
}
else
{
/* Auto mode */
if
((
co
->
PidAlg
&
IALG
)
!=
0
)
{
/* Incremental algorithm */
/* Integral-part */
if
((
*
o
->
IntOffP
==
FALSE
)
&&
(
co
->
IntTime
>
0
))
dut
=
co
->
ControlDiff
*
*
o
->
ScanTime
/
co
->
IntTime
;
else
dut
=
0
;
if
((
co
->
PidAlg
&
PALG
)
!=
0
)
{
/* Not pure I-controller */
/* Derivative-part */
if
((
co
->
PidAlg
&
DALG
)
!=
0
)
dut
+=
(
co
->
FiltDer
-
derold
);
/* P-part */
dut
+=
((
co
->
PidAlg
&
PAVV
)
!=
0
)
?
co
->
ControlDiff
-
eold
:
co
->
ProcVal
-
xold
;
dut
*=
co
->
Gain
;
}
if
(
co
->
Inverse
!=
0
)
dut
=
-
dut
;
/* Bias */
dut
+=
co
->
BiasGain
*
(
co
->
Bias
-
bfold
);
/* Limit output */
ut
=
co
->
OutVal
+
dut
;
if
(
co
->
MaxOut
>
co
->
MinOut
)
{
if
(
ut
>
co
->
MaxOut
)
{
ut
=
co
->
MaxOut
;
co
->
EndMin
=
FALSE
;
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
;
}
}
}
else
{
/* Nonincremental algorithm */
/* P-part */
ut
=
co
->
ControlDiff
;
/* Derivative-part */
if
((
co
->
PidAlg
&
DALG
)
!=
0
)
ut
+=
co
->
FiltDer
;
/* Gain */
ut
*=
co
->
Gain
;
if
(
co
->
Inverse
!=
0
)
ut
=
-
ut
;
/* Bias */
ut
+=
co
->
BiasGain
*
co
->
Bias
;
/* Limit output */
if
(
co
->
MaxOut
>
co
->
MinOut
)
{
if
(
ut
>
co
->
MaxOut
)
{
ut
=
co
->
MaxOut
;
co
->
EndMin
=
FALSE
;
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
;
}
/* Output Auto */
co
->
OutChange
=
dut
;
co
->
OutVal
=
ut
;
}
/* Transfer outputs */
o
->
OutVal
=
co
->
OutVal
;
o
->
OutChange
=
co
->
OutChange
;
o
->
ControlDiff
=
co
->
ControlDiff
;
o
->
EndMax
=
co
->
EndMax
;
o
->
EndMin
=
co
->
EndMin
;
}
...
...
bcomp/mmi/bcomp/src/pwr_c_compmodepid.pwg
0 → 100644
View file @
f92af1be
This diff is collapsed.
Click to expand it.
bcomp/mmi/bcomp/src/pwr_c_comppid.pwg
0 → 100644
View file @
f92af1be
This diff is collapsed.
Click to expand it.
xtt/changelog.txt
View file @
f92af1be
...
...
@@ -11,4 +11,5 @@
060516 cs ge Object instances can be used in graphs in Window and Folder objects.
060516 cs ge Possibility to use local database in DigLowColor, ToggleDig, Slider
insensitiv, and Invisible.
060516 cs ge Bit type added in Invisible to check visibility on bits in a bitmap.
\ No newline at end of file
060516 cs ge Bit type added in Invisible to check visibility on bits in a bitmap.
060522 cs ge Bugfix for $user attributes. Scan function for dynamics wasn't called.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment