| 1 | within Modelica.Blocks; |
|---|
| 2 | package Interfaces |
|---|
| 3 | "Library of connectors and partial models for input/output blocks" |
|---|
| 4 | import Modelica.SIunits; |
|---|
| 5 | extends Modelica.Icons.Library; |
|---|
| 6 | |
|---|
| 7 | annotation ( |
|---|
| 8 | |
|---|
| 9 | Documentation(info="<HTML> |
|---|
| 10 | <p> |
|---|
| 11 | This package contains interface definitions for |
|---|
| 12 | <b>continuous</b> input/output blocks with Real, |
|---|
| 13 | Integer and Boolean signals. Furthermore, it contains |
|---|
| 14 | partial models for continuous and discrete blocks. |
|---|
| 15 | </p> |
|---|
| 16 | |
|---|
| 17 | </HTML> |
|---|
| 18 | ", revisions="<html> |
|---|
| 19 | <ul> |
|---|
| 20 | <li><i>Oct. 21, 2002</i> |
|---|
| 21 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a> |
|---|
| 22 | and <a href=\"http://www.robotic.dlr.de/Christian.Schweiger/\">Christian Schweiger</a>:<br> |
|---|
| 23 | Added several new interfaces. <a href=\"../Documentation/ChangeNotes1.5.html\">Detailed description</a> available. |
|---|
| 24 | <li><i>Oct. 24, 1999</i> |
|---|
| 25 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> |
|---|
| 26 | RealInputSignal renamed to RealInput. RealOutputSignal renamed to |
|---|
| 27 | output RealOutput. GraphBlock renamed to BlockIcon. SISOreal renamed to |
|---|
| 28 | SISO. SOreal renamed to SO. I2SOreal renamed to M2SO. |
|---|
| 29 | SignalGenerator renamed to SignalSource. Introduced the following |
|---|
| 30 | new models: MIMO, MIMOs, SVcontrol, MVcontrol, DiscreteBlockIcon, |
|---|
| 31 | DiscreteBlock, DiscreteSISO, DiscreteMIMO, DiscreteMIMOs, |
|---|
| 32 | BooleanBlockIcon, BooleanSISO, BooleanSignalSource, MI2BooleanMOs.</li> |
|---|
| 33 | <li><i>June 30, 1999</i> |
|---|
| 34 | by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> |
|---|
| 35 | Realized a first version, based on an existing Dymola library |
|---|
| 36 | of Dieter Moormann and Hilding Elmqvist.</li> |
|---|
| 37 | </ul> |
|---|
| 38 | </html> |
|---|
| 39 | ")); |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | connector RealInput = input Real "'input Real' as connector" |
|---|
| 44 | annotation (defaultComponentName="u", |
|---|
| 45 | Icon(graphics={Polygon( |
|---|
| 46 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 47 | lineColor={0,0,127}, |
|---|
| 48 | fillColor={0,0,127}, |
|---|
| 49 | fillPattern=FillPattern.Solid)}, |
|---|
| 50 | coordinateSystem(extent={{-100,-100},{100,100}}, preserveAspectRatio=true, initialScale=0.2)), |
|---|
| 51 | Diagram(coordinateSystem( |
|---|
| 52 | preserveAspectRatio=true, initialScale=0.2, |
|---|
| 53 | extent={{-100,-100},{100,100}}, |
|---|
| 54 | grid={1,1}), graphics={Polygon( |
|---|
| 55 | points={{0,50},{100,0},{0,-50},{0,50}}, |
|---|
| 56 | lineColor={0,0,127}, |
|---|
| 57 | fillColor={0,0,127}, |
|---|
| 58 | fillPattern=FillPattern.Solid), Text( |
|---|
| 59 | extent={{-10,85},{-10,60}}, |
|---|
| 60 | lineColor={0,0,127}, |
|---|
| 61 | textString="%name")}), |
|---|
| 62 | Documentation(info="<html> |
|---|
| 63 | <p> |
|---|
| 64 | Connector with one input signal of type Real. |
|---|
| 65 | </p> |
|---|
| 66 | </html>")); |
|---|
| 67 | |
|---|
| 68 | connector RealOutput = output Real "'output Real' as connector" |
|---|
| 69 | annotation (defaultComponentName="y", |
|---|
| 70 | Icon(coordinateSystem( |
|---|
| 71 | preserveAspectRatio=true, |
|---|
| 72 | extent={{-100,-100},{100,100}}, |
|---|
| 73 | grid={1,1}), graphics={Polygon( |
|---|
| 74 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 75 | lineColor={0,0,127}, |
|---|
| 76 | fillColor={255,255,255}, |
|---|
| 77 | fillPattern=FillPattern.Solid)}), |
|---|
| 78 | Diagram(coordinateSystem( |
|---|
| 79 | preserveAspectRatio=true, |
|---|
| 80 | extent={{-100,-100},{100,100}}, |
|---|
| 81 | grid={1,1}), graphics={Polygon( |
|---|
| 82 | points={{-100,50},{0,0},{-100,-50},{-100,50}}, |
|---|
| 83 | lineColor={0,0,127}, |
|---|
| 84 | fillColor={255,255,255}, |
|---|
| 85 | fillPattern=FillPattern.Solid), Text( |
|---|
| 86 | extent={{30,110},{30,60}}, |
|---|
| 87 | lineColor={0,0,127}, |
|---|
| 88 | textString="%name")}), |
|---|
| 89 | Documentation(info="<html> |
|---|
| 90 | <p> |
|---|
| 91 | Connector with one output signal of type Real. |
|---|
| 92 | </p> |
|---|
| 93 | </html>")); |
|---|
| 94 | |
|---|
| 95 | connector BooleanInput = input Boolean "'input Boolean' as connector" |
|---|
| 96 | annotation (defaultComponentName="u", |
|---|
| 97 | Icon(graphics={Polygon( |
|---|
| 98 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 99 | lineColor={255,0,255}, |
|---|
| 100 | fillColor={255,0,255}, |
|---|
| 101 | fillPattern=FillPattern.Solid)}, |
|---|
| 102 | coordinateSystem(extent={{-100,-100},{100,100}}, |
|---|
| 103 | preserveAspectRatio=true, initialScale=0.2)), Diagram(coordinateSystem( |
|---|
| 104 | preserveAspectRatio=true, initialScale=0.2, |
|---|
| 105 | extent={{-100,-100},{100,100}}, |
|---|
| 106 | grid={1,1}), graphics={Polygon( |
|---|
| 107 | points={{0,50},{100,0},{0,-50},{0,50}}, |
|---|
| 108 | lineColor={255,0,255}, |
|---|
| 109 | fillColor={255,0,255}, |
|---|
| 110 | fillPattern=FillPattern.Solid), Text( |
|---|
| 111 | extent={{-10,85},{-10,60}}, |
|---|
| 112 | lineColor={255,0,255}, |
|---|
| 113 | textString="%name")}), |
|---|
| 114 | Documentation(info="<html> |
|---|
| 115 | <p> |
|---|
| 116 | Connector with one input signal of type Boolean. |
|---|
| 117 | </p> |
|---|
| 118 | </html>")); |
|---|
| 119 | |
|---|
| 120 | connector BooleanOutput = output Boolean "'output Boolean' as connector" |
|---|
| 121 | annotation (defaultComponentName="y", |
|---|
| 122 | Icon(coordinateSystem( |
|---|
| 123 | preserveAspectRatio=true, |
|---|
| 124 | extent={{-100,-100},{100,100}}, |
|---|
| 125 | grid={1,1}), graphics={Polygon( |
|---|
| 126 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 127 | lineColor={255,0,255}, |
|---|
| 128 | fillColor={255,255,255}, |
|---|
| 129 | fillPattern=FillPattern.Solid)}), |
|---|
| 130 | Diagram(coordinateSystem( |
|---|
| 131 | preserveAspectRatio=true, |
|---|
| 132 | extent={{-100,-100},{100,100}}, |
|---|
| 133 | grid={1,1}), graphics={Polygon( |
|---|
| 134 | points={{-100,50},{0,0},{-100,-50},{-100,50}}, |
|---|
| 135 | lineColor={255,0,255}, |
|---|
| 136 | fillColor={255,255,255}, |
|---|
| 137 | fillPattern=FillPattern.Solid), Text( |
|---|
| 138 | extent={{30,110},{30,60}}, |
|---|
| 139 | lineColor={255,0,255}, |
|---|
| 140 | textString="%name")}), |
|---|
| 141 | Documentation(info="<html> |
|---|
| 142 | <p> |
|---|
| 143 | Connector with one output signal of type Boolean. |
|---|
| 144 | </p> |
|---|
| 145 | </html>")); |
|---|
| 146 | |
|---|
| 147 | connector IntegerInput = input Integer "'input Integer' as connector" |
|---|
| 148 | annotation (defaultComponentName="u", |
|---|
| 149 | Icon(graphics={Polygon( |
|---|
| 150 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 151 | lineColor={255,127,0}, |
|---|
| 152 | fillColor={255,127,0}, |
|---|
| 153 | fillPattern=FillPattern.Solid)}, |
|---|
| 154 | coordinateSystem(extent={{-100,-100},{100,100}}, preserveAspectRatio=true, |
|---|
| 155 | initialScale=0.2)), |
|---|
| 156 | Diagram(coordinateSystem( |
|---|
| 157 | preserveAspectRatio=true, initialScale=0.2, |
|---|
| 158 | extent={{-100,-100},{100,100}}, |
|---|
| 159 | grid={1,1}), graphics={Polygon( |
|---|
| 160 | points={{0,50},{100,0},{0,-50},{0,50}}, |
|---|
| 161 | lineColor={255,127,0}, |
|---|
| 162 | fillColor={255,127,0}, |
|---|
| 163 | fillPattern=FillPattern.Solid), Text( |
|---|
| 164 | extent={{-10,85},{-10,60}}, |
|---|
| 165 | lineColor={255,127,0}, |
|---|
| 166 | textString="%name")}), |
|---|
| 167 | Documentation(info="<html> |
|---|
| 168 | <p> |
|---|
| 169 | Connector with one input signal of type Integer. |
|---|
| 170 | </p> |
|---|
| 171 | </html>")); |
|---|
| 172 | |
|---|
| 173 | connector IntegerOutput = output Integer "'output Integer' as connector" |
|---|
| 174 | annotation (defaultComponentName="y", |
|---|
| 175 | Icon(coordinateSystem( |
|---|
| 176 | preserveAspectRatio=true, |
|---|
| 177 | extent={{-100,-100},{100,100}}, |
|---|
| 178 | grid={1,1}), graphics={Polygon( |
|---|
| 179 | points={{-100,100},{100,0},{-100,-100},{-100,100}}, |
|---|
| 180 | lineColor={255,127,0}, |
|---|
| 181 | fillColor={255,255,255}, |
|---|
| 182 | fillPattern=FillPattern.Solid)}), |
|---|
| 183 | Diagram(coordinateSystem( |
|---|
| 184 | preserveAspectRatio=true, |
|---|
| 185 | extent={{-100,-100},{100,100}}, |
|---|
| 186 | grid={1,1}), graphics={Polygon( |
|---|
| 187 | points={{-100,50},{0,0},{-100,-50},{-100,50}}, |
|---|
| 188 | lineColor={255,127,0}, |
|---|
| 189 | fillColor={255,255,255}, |
|---|
| 190 | fillPattern=FillPattern.Solid), Text( |
|---|
| 191 | extent={{30,110},{30,60}}, |
|---|
| 192 | lineColor={255,127,0}, |
|---|
| 193 | textString="%name")}), |
|---|
| 194 | Documentation(info="<html> |
|---|
| 195 | <p> |
|---|
| 196 | Connector with one output signal of type Integer. |
|---|
| 197 | </p> |
|---|
| 198 | </html>")); |
|---|
| 199 | |
|---|
| 200 | partial block BlockIcon "Basic graphical layout of input/output block" |
|---|
| 201 | |
|---|
| 202 | annotation ( |
|---|
| 203 | |
|---|
| 204 | Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{ |
|---|
| 205 | 100,100}}), graphics={Rectangle( |
|---|
| 206 | extent={{-100,-100},{100,100}}, |
|---|
| 207 | lineColor={0,0,127}, |
|---|
| 208 | fillColor={255,255,255}, |
|---|
| 209 | fillPattern=FillPattern.Solid), Text( |
|---|
| 210 | extent={{-150,150},{150,110}}, |
|---|
| 211 | textString="%name", |
|---|
| 212 | lineColor={0,0,255})}), |
|---|
| 213 | Documentation(info="<html> |
|---|
| 214 | <p> |
|---|
| 215 | Block that has only the basic icon for an input/output |
|---|
| 216 | block (no declarations, no equations). Most blocks |
|---|
| 217 | of package Modelica.Blocks inherit directly or indirectly |
|---|
| 218 | from this block. |
|---|
| 219 | </p> |
|---|
| 220 | </html>")); |
|---|
| 221 | equation |
|---|
| 222 | |
|---|
| 223 | end BlockIcon; |
|---|
| 224 | |
|---|
| 225 | partial block SO "Single Output continuous control block" |
|---|
| 226 | extends BlockIcon; |
|---|
| 227 | |
|---|
| 228 | RealOutput y "Connector of Real output signal" |
|---|
| 229 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 230 | rotation=0))); |
|---|
| 231 | annotation ( |
|---|
| 232 | |
|---|
| 233 | Diagram(coordinateSystem( |
|---|
| 234 | preserveAspectRatio=true, |
|---|
| 235 | extent={{-100,-100},{100,100}}, |
|---|
| 236 | grid={2,2}), graphics), |
|---|
| 237 | Documentation(info="<html> |
|---|
| 238 | <p> |
|---|
| 239 | Block has one continuous Real output signal. |
|---|
| 240 | </p> |
|---|
| 241 | </html>")); |
|---|
| 242 | end SO; |
|---|
| 243 | |
|---|
| 244 | partial block MO "Multiple Output continuous control block" |
|---|
| 245 | extends BlockIcon; |
|---|
| 246 | |
|---|
| 247 | parameter Integer nout(min=1) = 1 "Number of outputs"; |
|---|
| 248 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 249 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 250 | rotation=0))); |
|---|
| 251 | annotation ( |
|---|
| 252 | |
|---|
| 253 | Documentation(info="<html> |
|---|
| 254 | <p> |
|---|
| 255 | Block has one continuous Real output signal vector. |
|---|
| 256 | </p> |
|---|
| 257 | </html>")); |
|---|
| 258 | end MO; |
|---|
| 259 | |
|---|
| 260 | partial block SISO "Single Input Single Output continuous control block" |
|---|
| 261 | extends BlockIcon; |
|---|
| 262 | |
|---|
| 263 | RealInput u "Connector of Real input signal" |
|---|
| 264 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 265 | rotation=0))); |
|---|
| 266 | RealOutput y "Connector of Real output signal" |
|---|
| 267 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 268 | rotation=0))); |
|---|
| 269 | annotation ( |
|---|
| 270 | Documentation(info="<html> |
|---|
| 271 | <p> |
|---|
| 272 | Block has one continuous Real input and one continuous Real output signal. |
|---|
| 273 | </p> |
|---|
| 274 | </html>")); |
|---|
| 275 | end SISO; |
|---|
| 276 | |
|---|
| 277 | partial block SI2SO |
|---|
| 278 | "2 Single Input / 1 Single Output continuous control block" |
|---|
| 279 | extends BlockIcon; |
|---|
| 280 | |
|---|
| 281 | RealInput u1 "Connector of Real input signal 1" |
|---|
| 282 | annotation (Placement(transformation(extent={{-140,40},{-100,80}}, |
|---|
| 283 | rotation=0))); |
|---|
| 284 | RealInput u2 "Connector of Real input signal 2" |
|---|
| 285 | annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}, |
|---|
| 286 | rotation=0))); |
|---|
| 287 | RealOutput y "Connector of Real output signal" |
|---|
| 288 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 289 | rotation=0))); |
|---|
| 290 | |
|---|
| 291 | annotation ( |
|---|
| 292 | |
|---|
| 293 | Documentation(info="<html> |
|---|
| 294 | <p> |
|---|
| 295 | Block has two continuous Real input signals u1 and u2 and one |
|---|
| 296 | continuous Real output signal y. |
|---|
| 297 | </p> |
|---|
| 298 | </html>"), |
|---|
| 299 | Diagram(coordinateSystem( |
|---|
| 300 | preserveAspectRatio=true, |
|---|
| 301 | extent={{-100,-100},{100,100}}, |
|---|
| 302 | grid={2,2}), graphics)); |
|---|
| 303 | end SI2SO; |
|---|
| 304 | |
|---|
| 305 | partial block SIMO "Single Input Multiple Output continuous control block" |
|---|
| 306 | extends BlockIcon; |
|---|
| 307 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 308 | RealInput u "Connector of Real input signal" |
|---|
| 309 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 310 | rotation=0))); |
|---|
| 311 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 312 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 313 | rotation=0))); |
|---|
| 314 | |
|---|
| 315 | annotation (Documentation(info="<HTML> |
|---|
| 316 | <p> Block has one continuous Real input signal and a |
|---|
| 317 | vector of continuous Real output signals.</p> |
|---|
| 318 | |
|---|
| 319 | </HTML> |
|---|
| 320 | ")); |
|---|
| 321 | end SIMO; |
|---|
| 322 | |
|---|
| 323 | partial block MISO "Multiple Input Single Output continuous control block" |
|---|
| 324 | |
|---|
| 325 | extends BlockIcon; |
|---|
| 326 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 327 | RealInput u[nin] "Connector of Real input signals" |
|---|
| 328 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 329 | rotation=0))); |
|---|
| 330 | RealOutput y "Connector of Real output signal" |
|---|
| 331 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 332 | rotation=0))); |
|---|
| 333 | annotation (Documentation(info="<HTML> |
|---|
| 334 | <p> |
|---|
| 335 | Block has a vector of continuous Real input signals and |
|---|
| 336 | one continuous Real output signal. |
|---|
| 337 | </p> |
|---|
| 338 | </HTML> |
|---|
| 339 | ")); |
|---|
| 340 | end MISO; |
|---|
| 341 | |
|---|
| 342 | partial block MIMO |
|---|
| 343 | "Multiple Input Multiple Output continuous control block" |
|---|
| 344 | |
|---|
| 345 | extends BlockIcon; |
|---|
| 346 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 347 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 348 | RealInput u[nin] "Connector of Real input signals" |
|---|
| 349 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 350 | rotation=0))); |
|---|
| 351 | RealOutput y[nout] "Connector of Real output signals" |
|---|
| 352 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 353 | rotation=0))); |
|---|
| 354 | annotation (Documentation(info="<HTML> |
|---|
| 355 | <p> |
|---|
| 356 | Block has a continuous Real input and a continuous Real output signal vector. |
|---|
| 357 | The signal sizes of the input and output vector may be different. |
|---|
| 358 | </p> |
|---|
| 359 | </HTML> |
|---|
| 360 | ")); |
|---|
| 361 | end MIMO; |
|---|
| 362 | |
|---|
| 363 | partial block MIMOs |
|---|
| 364 | "Multiple Input Multiple Output continuous control block with same number of inputs and outputs" |
|---|
| 365 | |
|---|
| 366 | extends BlockIcon; |
|---|
| 367 | parameter Integer n=1 "Number of inputs (= number of outputs)"; |
|---|
| 368 | RealInput u[n] "Connector of Real input signals" |
|---|
| 369 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 370 | rotation=0))); |
|---|
| 371 | RealOutput y[n] "Connector of Real output signals" |
|---|
| 372 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 373 | rotation=0))); |
|---|
| 374 | annotation ( |
|---|
| 375 | Documentation(info="<HTML> |
|---|
| 376 | <p> |
|---|
| 377 | Block has a continuous Real input and a continuous Real output signal vector |
|---|
| 378 | where the signal sizes of the input and output vector are identical. |
|---|
| 379 | </p> |
|---|
| 380 | </HTML> |
|---|
| 381 | ") ); |
|---|
| 382 | end MIMOs; |
|---|
| 383 | |
|---|
| 384 | partial block MI2MO |
|---|
| 385 | "2 Multiple Input / Multiple Output continuous control block" |
|---|
| 386 | extends BlockIcon; |
|---|
| 387 | |
|---|
| 388 | parameter Integer n=1 "Dimension of input and output vectors."; |
|---|
| 389 | |
|---|
| 390 | RealInput u1[n] "Connector 1 of Real input signals" |
|---|
| 391 | annotation (Placement(transformation(extent={{-140,40},{-100,80}}, |
|---|
| 392 | rotation=0))); |
|---|
| 393 | RealInput u2[n] "Connector 2 of Real input signals" |
|---|
| 394 | annotation (Placement(transformation(extent={{-140,-80},{-100,-40}}, |
|---|
| 395 | rotation=0))); |
|---|
| 396 | RealOutput y[n] "Connector of Real output signals" |
|---|
| 397 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 398 | rotation=0))); |
|---|
| 399 | annotation ( |
|---|
| 400 | |
|---|
| 401 | Documentation(info="<html> |
|---|
| 402 | <p> |
|---|
| 403 | Block has two continuous Real input vectors u1 and u2 and one |
|---|
| 404 | continuous Real output vector y. |
|---|
| 405 | All vectors have the same number of elements. |
|---|
| 406 | </p> |
|---|
| 407 | </html>"), |
|---|
| 408 | Diagram(coordinateSystem( |
|---|
| 409 | preserveAspectRatio=true, |
|---|
| 410 | extent={{-100,-100},{100,100}}, |
|---|
| 411 | grid={2,2}), graphics)); |
|---|
| 412 | end MI2MO; |
|---|
| 413 | |
|---|
| 414 | partial block SignalSource "Base class for continuous signal source" |
|---|
| 415 | extends SO; |
|---|
| 416 | parameter Real offset=0 "Offset of output signal y"; |
|---|
| 417 | parameter SIunits.Time startTime=0 |
|---|
| 418 | "Output y = offset for time < startTime"; |
|---|
| 419 | annotation (Documentation(info="<html> |
|---|
| 420 | <p> |
|---|
| 421 | Basic block for Real sources of package Blocks.Sources. |
|---|
| 422 | This component has one continuous Real output signal y |
|---|
| 423 | and two parameters (offset, startTime) to shift the |
|---|
| 424 | generated signal. |
|---|
| 425 | </p> |
|---|
| 426 | </html>")); |
|---|
| 427 | end SignalSource; |
|---|
| 428 | |
|---|
| 429 | partial block SVcontrol "Single-Variable continuous controller" |
|---|
| 430 | extends BlockIcon; |
|---|
| 431 | |
|---|
| 432 | RealInput u_s "Connector of setpoint input signal" |
|---|
| 433 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 434 | rotation=0))); |
|---|
| 435 | RealInput u_m "Connector of measurement input signal" |
|---|
| 436 | annotation (Placement(transformation( |
|---|
| 437 | origin={0,-120}, |
|---|
| 438 | extent={{20,-20},{-20,20}}, |
|---|
| 439 | rotation=270))); |
|---|
| 440 | RealOutput y "Connector of actuator output signal" |
|---|
| 441 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 442 | rotation=0))); |
|---|
| 443 | annotation ( |
|---|
| 444 | Diagram(coordinateSystem( |
|---|
| 445 | preserveAspectRatio=true, |
|---|
| 446 | extent={{-100,-100},{100,100}}, |
|---|
| 447 | grid={2,2}), graphics={ |
|---|
| 448 | Text( |
|---|
| 449 | extent={{-102,34},{-142,24}}, |
|---|
| 450 | textString="(setpoint)", |
|---|
| 451 | lineColor={0,0,255}), |
|---|
| 452 | Text( |
|---|
| 453 | extent={{100,24},{140,14}}, |
|---|
| 454 | textString="(actuator)", |
|---|
| 455 | lineColor={0,0,255}), |
|---|
| 456 | Text( |
|---|
| 457 | extent={{-83,-112},{-33,-102}}, |
|---|
| 458 | textString=" (measurement)", |
|---|
| 459 | lineColor={0,0,255})}) |
|---|
| 460 | , |
|---|
| 461 | Documentation(info="<html> |
|---|
| 462 | <p> |
|---|
| 463 | Block has two continuous Real input signals and one |
|---|
| 464 | continuous Real output signal. The block is designed |
|---|
| 465 | to be used as base class for a corresponding controller. |
|---|
| 466 | </p> |
|---|
| 467 | </html>")); |
|---|
| 468 | end SVcontrol; |
|---|
| 469 | |
|---|
| 470 | partial block MVcontrol "Multi-Variable continuous controller" |
|---|
| 471 | extends BlockIcon; |
|---|
| 472 | |
|---|
| 473 | parameter Integer nu_s=1 "Number of setpoint inputs"; |
|---|
| 474 | parameter Integer nu_m=1 "Number of measurement inputs"; |
|---|
| 475 | parameter Integer ny=1 "Number of actuator outputs"; |
|---|
| 476 | RealInput u_s[nu_s] "Connector of setpoint input signals" |
|---|
| 477 | annotation (Placement(transformation(extent={{-140,-20},{-100,20}}, |
|---|
| 478 | rotation=0))); |
|---|
| 479 | RealInput u_m[nu_m] "Connector of measurement input signals" |
|---|
| 480 | annotation (Placement(transformation( |
|---|
| 481 | origin={0,-120}, |
|---|
| 482 | extent={{20,-20},{-20,20}}, |
|---|
| 483 | rotation=270))); |
|---|
| 484 | RealOutput y[ny] "Connector of actuator output signals" |
|---|
| 485 | annotation (Placement(transformation(extent={{100,-10},{120,10}}, |
|---|
| 486 | rotation=0))); |
|---|
| 487 | annotation ( |
|---|
| 488 | Diagram(coordinateSystem( |
|---|
| 489 | preserveAspectRatio=true, |
|---|
| 490 | extent={{-100,-100},{100,100}}, |
|---|
| 491 | grid={2,2}), graphics={ |
|---|
| 492 | Text( |
|---|
| 493 | extent={{-100,36},{-140,26}}, |
|---|
| 494 | textString="(setpoint)", |
|---|
| 495 | lineColor={0,0,255}), |
|---|
| 496 | Text( |
|---|
| 497 | extent={{102,24},{142,14}}, |
|---|
| 498 | textString="(actuator)", |
|---|
| 499 | lineColor={0,0,255}), |
|---|
| 500 | Text( |
|---|
| 501 | extent={{-75,-108},{-25,-98}}, |
|---|
| 502 | textString=" (measurement)", |
|---|
| 503 | lineColor={0,0,255})}) |
|---|
| 504 | , |
|---|
| 505 | Documentation(info="<html> |
|---|
| 506 | <p> |
|---|
| 507 | Block has two continuous Real input signal vectors and one |
|---|
| 508 | continuous Real output signal vector. The block is designed |
|---|
| 509 | to be used as base class for a corresponding controller. |
|---|
| 510 | </p> |
|---|
| 511 | </html>")); |
|---|
| 512 | end MVcontrol; |
|---|
| 513 | |
|---|
| 514 | partial block DiscreteBlockIcon |
|---|
| 515 | "Graphical layout of discrete block component icon" |
|---|
| 516 | |
|---|
| 517 | annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
|---|
| 518 | -100},{100,100}}), graphics={Rectangle( |
|---|
| 519 | extent={{-100,-100},{100,100}}, |
|---|
| 520 | lineColor={0,0,127}, |
|---|
| 521 | fillColor={223,223,159}, |
|---|
| 522 | fillPattern=FillPattern.Solid), Text( |
|---|
| 523 | extent={{-150,150},{150,110}}, |
|---|
| 524 | textString="%name", |
|---|
| 525 | lineColor={0,0,255})}), |
|---|
| 526 | Documentation(info="<html> |
|---|
| 527 | <p> |
|---|
| 528 | Block that has only the basic icon for an input/output, |
|---|
| 529 | discrete block (no declarations, no equations), e.g., |
|---|
| 530 | from Blocks.Discrete. |
|---|
| 531 | </p> |
|---|
| 532 | </html>")); |
|---|
| 533 | equation |
|---|
| 534 | |
|---|
| 535 | end DiscreteBlockIcon; |
|---|
| 536 | |
|---|
| 537 | partial block DiscreteBlock "Base class of discrete control blocks" |
|---|
| 538 | extends DiscreteBlockIcon; |
|---|
| 539 | |
|---|
| 540 | parameter SI.Time samplePeriod(min=100*Modelica.Constants.eps, start = 0.1) |
|---|
| 541 | "Sample period of component"; |
|---|
| 542 | parameter SI.Time startTime=0 "First sample time instant"; |
|---|
| 543 | protected |
|---|
| 544 | output Boolean sampleTrigger "True, if sample time instant"; |
|---|
| 545 | output Boolean firstTrigger "Rising edge signals first sample instant"; |
|---|
| 546 | equation |
|---|
| 547 | sampleTrigger = sample(startTime, samplePeriod); |
|---|
| 548 | when sampleTrigger then |
|---|
| 549 | firstTrigger = time <= startTime + samplePeriod/2; |
|---|
| 550 | end when; |
|---|
| 551 | annotation (Documentation(info="<html> |
|---|
| 552 | <p> |
|---|
| 553 | Basic definitions of a discrete block of library |
|---|
| 554 | Blocks.Discrete. |
|---|
| 555 | </p> |
|---|
| 556 | </html>")); |
|---|
| 557 | end DiscreteBlock; |
|---|
| 558 | |
|---|
| 559 | partial block DiscreteSISO |
|---|
| 560 | "Single Input Single Output discrete control block" |
|---|
| 561 | |
|---|
| 562 | extends DiscreteBlock; |
|---|
| 563 | |
|---|
| 564 | Modelica.Blocks.Interfaces.RealInput u "Continuous input signal" |
|---|
| 565 | annotation (Placement(transformation(extent={ |
|---|
| 566 | {-140,-20},{-100,20}}, rotation=0))); |
|---|
| 567 | Modelica.Blocks.Interfaces.RealOutput y "Continuous output signal" |
|---|
| 568 | annotation (Placement(transformation(extent= |
|---|
| 569 | {{100,-10},{120,10}}, rotation=0))); |
|---|
| 570 | annotation (Documentation(info="<html> |
|---|
| 571 | <p> |
|---|
| 572 | Block has one continuous input and one continuous output signal |
|---|
| 573 | which are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 574 | </p> |
|---|
| 575 | </html>")); |
|---|
| 576 | end DiscreteSISO; |
|---|
| 577 | |
|---|
| 578 | partial block DiscreteMIMO |
|---|
| 579 | "Multiple Input Multiple Output discrete control block" |
|---|
| 580 | |
|---|
| 581 | extends DiscreteBlock; |
|---|
| 582 | parameter Integer nin=1 "Number of inputs"; |
|---|
| 583 | parameter Integer nout=1 "Number of outputs"; |
|---|
| 584 | |
|---|
| 585 | Modelica.Blocks.Interfaces.RealInput u[nin] "Continuous input signals" |
|---|
| 586 | annotation (Placement(transformation(extent= |
|---|
| 587 | {{-140,-20},{-100,20}}, rotation=0))); |
|---|
| 588 | Modelica.Blocks.Interfaces.RealOutput y[nout] "Continuous output signals" |
|---|
| 589 | annotation (Placement(transformation(extent= |
|---|
| 590 | {{100,-10},{120,10}}, rotation=0))); |
|---|
| 591 | |
|---|
| 592 | annotation (Documentation(info="<html> |
|---|
| 593 | <p> |
|---|
| 594 | Block has a continuous input and a continuous output signal vector |
|---|
| 595 | which are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 596 | </p> |
|---|
| 597 | </HTML> |
|---|
| 598 | ")); |
|---|
| 599 | end DiscreteMIMO; |
|---|
| 600 | |
|---|
| 601 | partial block DiscreteMIMOs |
|---|
| 602 | "Multiple Input Multiple Output discrete control block" |
|---|
| 603 | parameter Integer n=1 "Number of inputs (= number of outputs)"; |
|---|
| 604 | extends DiscreteBlock; |
|---|
| 605 | |
|---|
| 606 | Modelica.Blocks.Interfaces.RealInput u[n] "Continuous input signals" |
|---|
| 607 | annotation (Placement(transformation(extent= |
|---|
| 608 | {{-140,-20},{-100,20}}, rotation=0))); |
|---|
| 609 | Modelica.Blocks.Interfaces.RealOutput y[n] "Continuous output signals" |
|---|
| 610 | annotation (Placement(transformation(extent= |
|---|
| 611 | {{100,-10},{120,10}}, rotation=0))); |
|---|
| 612 | |
|---|
| 613 | annotation (Documentation(info="<html> |
|---|
| 614 | <p> |
|---|
| 615 | Block has a continuous input and a continuous output signal vector |
|---|
| 616 | where the signal sizes of the input and output vector are identical. |
|---|
| 617 | These signals are sampled due to the defined <b>samplePeriod</b> parameter. |
|---|
| 618 | </p> |
|---|
| 619 | </HTML> |
|---|
| 620 | ")); |
|---|
| 621 | |
|---|
| 622 | end DiscreteMIMOs; |
|---|
| 623 | |
|---|
| 624 | partial block SVdiscrete "Discrete Single-Variable controller" |
|---|
| 625 | extends DiscreteBlock; |
|---|
| 626 | |
|---|
| 627 | Discrete.Sampler sampler_s( |
|---|
| 628 | final samplePeriod=samplePeriod, |
|---|
| 629 | fin |
|---|