Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
i.elizarov
Fluid system CP and TD
Commits
63380c9a
Commit
63380c9a
authored
Jan 19, 2022
by
Ilya Elizarov
Browse files
Correct coefficients for the pump's PID have been chosen
parent
126bbc75
Changes
1
Hide whitespace changes
Inline
Side-by-side
CoolingSystem/Experimental/ControlSystem.mo
View file @
63380c9a
within
CoolingSystem
.
Experimental
;
model
ControlSystem
extends
CoolingSystem
.
Devices
.
CoolingPlant
;
parameter
Modelica
.
SIunits
.
Time
startTime
=
100
;
parameter
Modelica
.
SIunits
.
Time
duration
=
30
;
parameter
Real
opening
(
min
=
0
,
max
=
1
)
=
0.8
;
parameter
Modelica
.
SIunits
.
Time
pause
=
20
;
CoolingSystem
.
Devices
.
Pipelines
pipelines1
annotation
(
CoolingSystem
.
Devices
.
Pipelines
pipelines1
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
90
,
-
28
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
CoolingSystem
.
Devices
.
ThermalDemonstrator
thermal_demonstrator1
(
leakage
=
0.05
)
annotation
(
CoolingSystem
.
Devices
.
ThermalDemonstrator
thermal_demonstrator1
(
leakage
=
0.05
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
180
,
-
12
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Constant
const3
(
k
=
1
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Constant
const3
(
k
=
1
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
50
,
-
70
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Ramp
op1
(
duration
=
duration
,
height
=
opening
,
startTime
=
100
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Ramp
op1
(
duration
=
duration
,
height
=
opening
,
startTime
=
100
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
128
,
48
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Ramp
op2
(
duration
=
duration
,
height
=
opening
,
startTime
=
op1
.
startTime
+
op1
.
duration
+
pause
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Ramp
op2
(
duration
=
duration
,
height
=
opening
,
startTime
=
op1
.
startTime
+
op1
.
duration
+
pause
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
128
,
18
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Ramp
op3
(
duration
=
duration
,
height
=
opening
,
startTime
=
op2
.
startTime
+
op2
.
duration
+
pause
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Ramp
op3
(
duration
=
duration
,
height
=
opening
,
startTime
=
op2
.
startTime
+
op2
.
duration
+
pause
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
128
,
-
14
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Ramp
op4
(
duration
=
duration
,
height
=
opening
,
startTime
=
op3
.
startTime
+
op3
.
duration
+
pause
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Ramp
op4
(
duration
=
duration
,
height
=
opening
,
startTime
=
op3
.
startTime
+
op3
.
duration
+
pause
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
128
,
-
48
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Ramp
op5
(
duration
=
duration
,
height
=
opening
,
startTime
=
op4
.
startTime
+
op4
.
duration
+
pause
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Ramp
op5
(
duration
=
duration
,
height
=
opening
,
startTime
=
op4
.
startTime
+
op4
.
duration
+
pause
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
128
,
-
80
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Continuous
.
FirstOrder
firstOrder2
(
T
=
60
,
y_start
=
0
)
annotation
(
Modelica
.
Blocks
.
Continuous
.
FirstOrder
firstOrder2
(
T
=
60
,
y_start
=
0
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
236
,
30
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Step
step
(
startTime
=
op5
.
startTime
+
op5
.
duration
+
5
*
pause
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Step
step
(
startTime
=
op5
.
startTime
+
op5
.
duration
+
5
*
pause
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{
206
,
30
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Step
step1
(
height
=
-
60
,
offset
=
273.15
+
20
,
startTime
=
step
.
startTime
)
annotation
(
Modelica
.
Blocks
.
Sources
.
Step
step1
(
height
=
-
60
,
offset
=
273.15
+
20
,
startTime
=
step
.
startTime
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
150
,
8
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
IBPSA
.
Controls
.
Continuous
.
LimPID
pumpPID
(
Ti
=
0.5e-3
,
controllerType
=
Modelica
.
Blocks
.
Types
.
SimpleController
.
PID
,
k
=
50e-06
,
strict
=
true
,
yMin
=
0.2
,
y_start
=
0.2
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
90
,
110
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Constant
setPD
(
k
=
1.5e5
)
annotation
(
IBPSA
.
Controls
.
Continuous
.
LimPID
pumpPID
(
Ti
=
0.5e2
/
2
,
controllerType
=
Modelica
.
Blocks
.
Types
.
SimpleController
.
PID
,
k
=
100e-6
,
Td
=
0.5
,
strict
=
true
,
yMin
=
0.2
,
y_start
=
0.2
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
={-
90
,
110
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
Modelica
.
Blocks
.
Sources
.
Constant
setPD
(
k
=
1.5e5
)
annotation
(
Placement
(
visible
=
true
,
transformation
(
origin
=
{-
134
,
110
},
extent
=
{{-
10
,
-
10
},
{
10
,
10
}},
rotation
=
0
)));
equation
connect
(
op1
.
y
,
thermal_demonstrator1
.
u1
)
annotation
(
Line
(
points
=
{{
139
,
48
},
{
159
,
48
},
{
159
,
-
2
},
{
16
7
,
-
2
}},
color
=
{
0
,
0
,
127
}));
connect
(
op2
.
y
,
thermal_demonstrator1
.
u2
)
annotation
(
Line
(
points
=
{{
139
,
18
},
{
155
,
18
},
{
155
,
-
8
},
{
16
7
,
-
8
}},
color
=
{
0
,
0
,
127
}));
connect
(
op3
.
y
,
thermal_demonstrator1
.
u3
)
annotation
(
Line
(
points
=
{{
139
,
-
14
},
{
155
,
-
14
},
{
155
,
-
12
},
{
16
7
,
-
12
}},
color
=
{
0
,
0
,
127
}));
connect
(
op4
.
y
,
thermal_demonstrator1
.
u4
)
annotation
(
Line
(
points
=
{{
139
,
-
48
},
{
153
,
-
48
},
{
153
,
-
1
8
},
{
16
7
,
-
18
}},
color
=
{
0
,
0
,
127
}));
connect
(
op5
.
y
,
thermal_demonstrator1
.
u5
)
annotation
(
Line
(
points
=
{{
139
,
-
80
},
{
157
,
-
80
},
{
157
,
-
22
},
{
16
7
,
-
22
}},
color
=
{
0
,
0
,
127
}));
connect
(
firstOrder2
.
y
,
thermal_demonstrator1
.
u
)
annotation
(
connect
(
op1
.
y
,
thermal_demonstrator1
.
u1
)
annotation
(
Line
(
points
=
{{
139
,
48
},{
159
,
48
},{
159
,
-
3
},{
16
8
,-
3
}},
color
=
{
0
,
0
,
127
}));
connect
(
op2
.
y
,
thermal_demonstrator1
.
u2
)
annotation
(
Line
(
points
=
{{
139
,
18
},{
155
,
18
},{
155
,-
7.
8
},{
16
8
,-
7.8
}},
color
=
{
0
,
0
,
127
}));
connect
(
op3
.
y
,
thermal_demonstrator1
.
u3
)
annotation
(
Line
(
points
=
{{
139
,-
14
},{
155
,-
14
},{
155
,-
12
.8
},{
16
8
,
-
12
.8
}},
color
=
{
0
,
0
,
127
}));
connect
(
op4
.
y
,
thermal_demonstrator1
.
u4
)
annotation
(
Line
(
points
=
{{
139
,-
48
},{
153
,-
48
},{
153
,-
1
7.6
},{
16
8
,-
17.6
}},
color
=
{
0
,
0
,
127
}));
connect
(
op5
.
y
,
thermal_demonstrator1
.
u5
)
annotation
(
Line
(
points
=
{{
139
,-
80
},{
157
,-
80
},{
157
,-
22
.4
},{
16
8
,
-
22
.4
}},
color
=
{
0
,
0
,
127
}));
connect
(
firstOrder2
.
y
,
thermal_demonstrator1
.
u
)
annotation
(
Line
(
points
=
{{
247
,
30
},
{
256
,
30
},
{
256
,
-
6
},
{
192
,
-
6
}},
color
=
{
0
,
0
,
127
}));
connect
(
step
.
y
,
firstOrder2
.
u
)
annotation
(
connect
(
step
.
y
,
firstOrder2
.
u
)
annotation
(
Line
(
points
=
{{
217
,
30
},
{
224
,
30
}},
color
=
{
0
,
0
,
127
}));
connect
(
pipelines1
.
port_T2_a
,
thermal_demonstrator1
.
port_b
)
annotation
(
Line
(
points
=
{{
100
,
-
2
3
},
{
106
,
-
2
3
},
{
106
,
68
},
{
180
,
68
},
{
180
,
-
2
}},
color
=
{
0
,
127
,
255
}));
connect
(
thermal_demonstrator1
.
port_a
,
pipelines1
.
port_T1_b
)
annotation
(
Line
(
points
=
{{
180
,
-
22
},
{
180
,
-
108
},
{
106
,
-
108
},
{
106
,
-
3
3
},
{
100
,
-
3
3
}},
color
=
{
0
,
127
,
255
}));
connect
(
step1
.
y
,
firstOrder
.
u
)
annotation
(
Line
(
points
=
{{-
139
,
8
},
{-
8
6
,
8
}},
color
=
{
0
,
0
,
127
}));
connect
(
const3
.
y
,
val
.
y
)
annotation
(
Line
(
points
=
{{-
3
8
,
-
70
},
{-
20
,
-
70
},
{-
20
,
-
46
}},
color
=
{
0
,
0
,
127
}));
connect
(
pipelines1
.
port_b
,
senTem_T2
.
port_a
)
annotation
(
connect
(
pipelines1
.
port_T2_a
,
thermal_demonstrator1
.
port_b
)
annotation
(
Line
(
points
=
{{
100
,-
2
2.8
},{
106
,-
2
2.8
},{
106
,
68
},{
180
,
68
},{
180
,-
2
}},
color
=
{
0
,
127
,
255
}));
connect
(
thermal_demonstrator1
.
port_a
,
pipelines1
.
port_T1_b
)
annotation
(
Line
(
points
=
{{
180
,-
22
},{
180
,-
108
},{
106
,-
108
},{
106
,-
3
2.6
},{
100
,-
3
2.6
}},
color
=
{
0
,
127
,
255
}));
connect
(
step1
.
y
,
firstOrder
.
u
)
annotation
(
Line
(
points
=
{{-
139
,
8
},{-
121.
6
,
8
}},
color
=
{
0
,
0
,
127
}));
connect
(
const3
.
y
,
val
.
y
)
annotation
(
Line
(
points
=
{{-
3
9
,
-
70
},{-
20
,-
70
},{-
20
,-
46
}},
color
=
{
0
,
0
,
127
}));
connect
(
pipelines1
.
port_b
,
senTem_T2
.
port_a
)
annotation
(
Line
(
points
=
{{
80
,
-
23
},
{
74
,
-
23
},
{
74
,
34
},
{
50
,
34
}},
color
=
{
0
,
127
,
255
}));
connect
(
pipelines1
.
port_T1_a
,
senTem_T1
.
port_b
)
annotation
(
Line
(
points
=
{{
80
,
-
33
},
{
74
,
-
3
3
},
{
74
,
-
34
},
{
50
,
-
34
}},
color
=
{
0
,
127
,
255
}));
connect
(
pumpPID
.
y
,
pump
.
y
)
annotation
(
Line
(
points
=
{{-
7
8
,
110
},
{-
30
,
110
},
{-
30
,
46
}},
color
=
{
0
,
0
,
127
}));
connect
(
setPD
.
y
,
pumpPID
.
u_s
)
annotation
(
Line
(
points
=
{{-
12
2
,
110
},
{-
102
,
110
}},
color
=
{
0
,
0
,
127
}));
connect
(
pumpPID
.
u_m
,
senRelPre
.
p_rel
)
annotation
(
Line
(
points
=
{{-
90
,
98
},
{-
90
,
80
},
{-
42
,
80
},
{-
42
,
64
},
{
84
,
64
},
{
84
,
2
},
{
70
,
2
}},
color
=
{
0
,
0
,
127
}));
connect
(
pipelines1
.
port_T1_a
,
senTem_T1
.
port_b
)
annotation
(
Line
(
points
=
{{
80
.2
,-
32.8
},{
74
,-
3
2.8
},{
74
,-
34
},{
50
,-
34
}},
color
=
{
0
,
127
,
255
}));
connect
(
pumpPID
.
y
,
pump
.
y
)
annotation
(
Line
(
points
=
{{-
7
9
,
110
},{-
30
,
110
},{-
30
,
46
}},
color
=
{
0
,
0
,
127
}));
connect
(
setPD
.
y
,
pumpPID
.
u_s
)
annotation
(
Line
(
points
=
{{-
12
3
,
110
},{-
102
,
110
}},
color
=
{
0
,
0
,
127
}));
connect
(
pumpPID
.
u_m
,
senRelPre
.
p_rel
)
annotation
(
Line
(
points
=
{{-
90
,
98
},{-
90
,
80
},{-
42
,
80
},{-
42
,
64
},{
84
,
64
},{
84
,
2
},
{
69
,
2
}},
color
=
{
0
,
0
,
127
}));
end
ControlSystem
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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