Changeset 381
- Timestamp:
- 03/01/2006 09:37:47 AM (3 years ago)
- Location:
- Modelica/trunk
- Files:
-
- 4 modified
-
Blocks/Interfaces.mo (modified) (69 diffs)
-
Blocks/Nonlinear.mo (modified) (16 diffs)
-
Blocks/Sources.mo (modified) (50 diffs)
-
Mechanics/MultiBody/Examples/Systems/RobotR3.mo (modified) (48 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Modelica/trunk/Blocks/Interfaces.mo
r360 r381 1 package Interfaces "Connectors and partial models for input/output blocks" 1 package Interfaces "Connectors and partial models for input/output blocks" 2 2 import Modelica.SIunits; 3 3 extends Modelica.Icons.Library; 4 4 5 5 annotation(preferedView="info", 6 6 Coordsys( … … 31 31 Added several new interfaces. <a href=\"../Documentation/ChangeNotes1.5.html\">Detailed description</a> available. 32 32 <li><i>Oct. 24, 1999</i> 33 by <a href=\"http://www. op.dlr.de/~otter/\">Martin Otter</a>:<br>33 by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> 34 34 RealInputSignal renamed to RealInput. RealOutputSignal renamed to 35 35 output RealOutput. GraphBlock renamed to BlockIcon. SISOreal renamed to … … 40 40 BooleanBlockIcon, BooleanSISO, BooleanSignalSource, MI2BooleanMOs.</li> 41 41 <li><i>June 30, 1999</i> 42 by <a href=\"http://www. op.dlr.de/~otter/\">Martin Otter</a>:<br>42 by <a href=\"http://www.robotic.dlr.de/Martin.Otter/\">Martin Otter</a>:<br> 43 43 Realized a first version, based on an existing Dymola library 44 44 of Dieter Moormann and Hilding Elmqvist.</li> … … 46 46 </html> 47 47 ")); 48 49 connector RealSignal "Real port (both input/output possible)" 48 49 connector RealSignal "Real port (both input/output possible)" 50 50 replaceable type SignalType = Real; 51 51 52 52 extends SignalType; 53 53 54 54 annotation (Documentation(info="<html> 55 55 <p> … … 58 58 </html>")); 59 59 end RealSignal; 60 61 connector BooleanSignal = Boolean "Boolean port (both input/output possible)" 60 61 connector BooleanSignal = Boolean "Boolean port (both input/output possible)" 62 62 annotation (Documentation(info="<html> 63 63 <p> … … 65 65 </p> 66 66 </html>")); 67 connector IntegerSignal = Integer "Integer port (both input/output possible)" 67 connector IntegerSignal = Integer "Integer port (both input/output possible)" 68 68 annotation (Documentation(info="<html> 69 69 <p> … … 71 71 </p> 72 72 </html>")); 73 74 connector RealInput = input RealSignal "'input Real' as connector" 73 74 connector RealInput = input RealSignal "'input Real' as connector" 75 75 annotation (defaultComponentName="u", 76 76 Coordsys(extent=[-100, -100; 100, 100], … … 98 98 </p> 99 99 </html>")); 100 101 connector RealOutput = output RealSignal "'output Real' as connector" 100 101 connector RealOutput = output RealSignal "'output Real' as connector" 102 102 annotation (defaultComponentName="y", 103 103 Coordsys(extent=[-100, -100; 100, 100], … … 123 123 </p> 124 124 </html>")); 125 126 connector BooleanInput = input BooleanSignal "'input Boolean' as connector" 125 126 connector BooleanInput = input BooleanSignal "'input Boolean' as connector" 127 127 annotation (defaultComponentName="u", 128 128 Icon(coordinateSystem(extent=[-100,-100; 100,100]), … … 141 141 </p> 142 142 </html>")); 143 144 connector BooleanOutput = output BooleanSignal "'output Boolean' as connector" 143 144 connector BooleanOutput = output BooleanSignal "'output Boolean' as connector" 145 145 annotation (defaultComponentName="y", 146 146 Coordsys(extent=[-100, -100; 100, 100], … … 159 159 </p> 160 160 </html>")); 161 162 connector IntegerInput = input IntegerSignal "'input Integer' as connector" 161 162 connector IntegerInput = input IntegerSignal "'input Integer' as connector" 163 163 annotation (defaultComponentName="u", 164 164 Coordsys( … … 180 180 </p> 181 181 </html>")); 182 183 connector IntegerOutput = output IntegerSignal "'output Integer' as connector" 182 183 connector IntegerOutput = output IntegerSignal "'output Integer' as connector" 184 184 annotation (defaultComponentName="y", 185 185 Coordsys( … … 199 199 </p> 200 200 </html>")); 201 202 partial block BlockIcon "Basic graphical layout of input/output block" 201 202 partial block BlockIcon "Basic graphical layout of input/output block" 203 203 annotation ( 204 204 Coordsys(extent=[-100, -100; 100, 100]), … … 223 223 </p> 224 224 </html>")); 225 equation 226 225 equation 226 227 227 end BlockIcon; 228 229 partial block SO "Single Output continuous control block" 228 229 partial block SO "Single Output continuous control block" 230 230 extends BlockIcon; 231 232 RealOutput y "Connector of Real output signal" 231 232 RealOutput y "Connector of Real output signal" 233 233 annotation (extent=[100, -10; 120, 10]); 234 234 annotation ( … … 249 249 </html>")); 250 250 end SO; 251 252 partial block MO "Multiple Output continuous control block" 251 252 partial block MO "Multiple Output continuous control block" 253 253 extends BlockIcon; 254 254 255 255 parameter Integer nout(min=1) = 1 "Number of outputs"; 256 RealOutput y[nout] "Connector of Real output signals" 256 RealOutput y[nout] "Connector of Real output signals" 257 257 annotation (extent=[100, -10; 120, 10]); 258 258 annotation ( … … 272 272 </html>")); 273 273 end MO; 274 275 partial block SISO "Single Input Single Output continuous control block" 274 275 partial block SISO "Single Input Single Output continuous control block" 276 276 extends BlockIcon; 277 278 RealInput u "Connector of Real input signal" 277 278 RealInput u "Connector of Real input signal" 279 279 annotation (extent=[-140, -20; -100, 20]); 280 RealOutput y "Connector of Real output signal" 280 RealOutput y "Connector of Real output signal" 281 281 annotation (extent=[100, -10; 120, 10]); 282 282 annotation (Coordsys( … … 294 294 </html>")); 295 295 end SISO; 296 297 partial block SI2SO 298 "2 Single Input / 1 Single Output continuous control block" 296 297 partial block SI2SO 298 "2 Single Input / 1 Single Output continuous control block" 299 299 extends BlockIcon; 300 301 RealInput u1 "Connector of Real input signal 1" 300 301 RealInput u1 "Connector of Real input signal 1" 302 302 annotation (extent=[-140, 40; -100, 80]); 303 RealInput u2 "Connector of Real input signal 2" 303 RealInput u2 "Connector of Real input signal 2" 304 304 annotation (extent=[-140, -80; -100, -40]); 305 RealOutput y "Connector of Real output signal" 305 RealOutput y "Connector of Real output signal" 306 306 annotation (extent=[100, -10; 120, 10]); 307 307 308 308 annotation ( 309 309 Coordsys( … … 319 319 <p> 320 320 Block has two continuous Real input signals u1 and u2 and one 321 continuous Real output signal y. 321 continuous Real output signal y. 322 322 </p> 323 323 </html>"), 324 324 Diagram); 325 325 end SI2SO; 326 327 partial block SIMO "Single Input Multiple Output continuous control block" 326 327 partial block SIMO "Single Input Multiple Output continuous control block" 328 328 extends BlockIcon; 329 329 parameter Integer nout=1 "Number of outputs"; 330 RealInput u "Connector of Real input signal" 330 RealInput u "Connector of Real input signal" 331 331 annotation (extent=[-140, -20; -100, 20]); 332 RealOutput y[nout] "Connector of Real output signals" 332 RealOutput y[nout] "Connector of Real output signals" 333 333 annotation (extent=[100, -10; 120, 10]); 334 334 335 335 annotation (Documentation(info="<HTML> 336 <p> Block has one continuous Real input signal and a 336 <p> Block has one continuous Real input signal and a 337 337 vector of continuous Real output signals.</p> 338 338 … … 340 340 ")); 341 341 end SIMO; 342 343 partial block MISO "Multiple Input Single Output continuous control block" 344 342 343 partial block MISO "Multiple Input Single Output continuous control block" 344 345 345 extends BlockIcon; 346 346 parameter Integer nin=1 "Number of inputs"; 347 RealInput u[nin] "Connector of Real input signals" 347 RealInput u[nin] "Connector of Real input signals" 348 348 annotation (extent=[-140, -20; -100, 20]); 349 RealOutput y "Connector of Real output signal" 349 RealOutput y "Connector of Real output signal" 350 350 annotation (extent=[100, -10; 120, 10]); 351 351 annotation (Documentation(info="<HTML> … … 357 357 ")); 358 358 end MISO; 359 360 partial block MIMO 361 "Multiple Input Multiple Output continuous control block" 362 359 360 partial block MIMO 361 "Multiple Input Multiple Output continuous control block" 362 363 363 extends BlockIcon; 364 364 parameter Integer nin=1 "Number of inputs"; 365 365 parameter Integer nout=1 "Number of outputs"; 366 RealInput u[nin] "Connector of Real input signals" 366 RealInput u[nin] "Connector of Real input signals" 367 367 annotation (extent=[-140, -20; -100, 20]); 368 RealOutput y[nout] "Connector of Real output signals" 368 RealOutput y[nout] "Connector of Real output signals" 369 369 annotation (extent=[100, -10; 120, 10]); 370 370 annotation (Documentation(info="<HTML> … … 376 376 ")); 377 377 end MIMO; 378 379 partial block MIMOs 380 "Multiple Input Multiple Output continuous control block with same number of inputs and outputs" 381 378 379 partial block MIMOs 380 "Multiple Input Multiple Output continuous control block with same number of inputs and outputs" 381 382 382 extends BlockIcon; 383 383 parameter Integer n=1 "Number of inputs (= number of outputs)"; 384 RealInput u[n] "Connector of Real input signals" 384 RealInput u[n] "Connector of Real input signals" 385 385 annotation (extent=[-140, -20; -100, 20]); 386 RealOutput y[n] "Connector of Real output signals" 386 RealOutput y[n] "Connector of Real output signals" 387 387 annotation (extent=[100, -10; 120, 10]); 388 388 annotation ( … … 403 403 height=0.6)); 404 404 end MIMOs; 405 406 partial block MI2MO 407 "2 Multiple Input / Multiple Output continuous control block" 405 406 partial block MI2MO 407 "2 Multiple Input / Multiple Output continuous control block" 408 408 extends BlockIcon; 409 409 410 410 parameter Integer n=1 "Dimension of input and output vectors."; 411 412 RealInput u1[n] "Connector 1 of Real input signals" 411 412 RealInput u1[n] "Connector 1 of Real input signals" 413 413 annotation (extent=[-140, 40; -100, 80]); 414 RealInput u2[n] "Connector 2 of Real input signals" 414 RealInput u2[n] "Connector 2 of Real input signals" 415 415 annotation (extent=[-140, -80; -100, -40]); 416 RealOutput y[n] "Connector of Real output signals" 416 RealOutput y[n] "Connector of Real output signals" 417 417 annotation (extent=[100, -10; 120, 10]); 418 418 annotation ( … … 429 429 <p> 430 430 Block has two continuous Real input vectors u1 and u2 and one 431 continuous Real output vector y. 431 continuous Real output vector y. 432 432 All vectors have the same number of elements. 433 433 </p> … … 435 435 Diagram); 436 436 end MI2MO; 437 438 partial block SignalSource "Base class for continuous signal source" 437 438 partial block SignalSource "Base class for continuous signal source" 439 439 extends SO; 440 440 parameter Real offset=0 "offset of output signal"; … … 445 445 This component has one continuous Real output signal y 446 446 and two parameters (offset, startTime) to shift the 447 generated signal. 447 generated signal. 448 448 </p> 449 449 </html>")); 450 450 end SignalSource; 451 452 partial block SVcontrol "Single-Variable continuous controller" 451 452 partial block SVcontrol "Single-Variable continuous controller" 453 453 extends BlockIcon; 454 455 RealInput u_s "Connector of setpoint input signal" 454 455 RealInput u_s "Connector of setpoint input signal" 456 456 annotation (extent=[-140, -20; -100, 20]); 457 RealInput u_m "Connector of measurement input signal" 457 RealInput u_m "Connector of measurement input signal" 458 458 annotation (extent=[20, -100; -20, -140], rotation=-90); 459 RealOutput y "Connector of actuator output signal" 459 RealOutput y "Connector of actuator output signal" 460 460 annotation (extent=[100, -10; 120, 10]); 461 461 annotation ( … … 477 477 Block has two continuous Real input signals and one 478 478 continuous Real output signal. The block is designed 479 to be used as base class for a corresponding controller. 479 to be used as base class for a corresponding controller. 480 480 </p> 481 481 </html>")); 482 482 end SVcontrol; 483 484 partial block MVcontrol "Multi-Variable continuous controller" 483 484 partial block MVcontrol "Multi-Variable continuous controller" 485 485 extends BlockIcon; 486 486 487 487 parameter Integer nu_s=1 "Number of setpoint inputs"; 488 488 parameter Integer nu_m=1 "Number of measurement inputs"; 489 489 parameter Integer ny=1 "Number of actuator outputs"; 490 RealInput u_s[nu_s] "Connector of setpoint input signals" 490 RealInput u_s[nu_s] "Connector of setpoint input signals" 491 491 annotation (extent=[-140, -20; -100, 20]); 492 RealInput u_m[nu_m] "Connector of measurement input signals" 492 RealInput u_m[nu_m] "Connector of measurement input signals" 493 493 annotation (extent=[20, -100; -20, -140], rotation=-90); 494 RealOutput y[ny] "Connector of actuator output signals" 494 RealOutput y[ny] "Connector of actuator output signals" 495 495 annotation (extent=[100, -10; 120, 10]); 496 496 annotation ( … … 512 512 Block has two continuous Real input signal vectors and one 513 513 continuous Real output signal vector. The block is designed 514 to be used as base class for a corresponding controller. 514 to be used as base class for a corresponding controller. 515 515 </p> 516 516 </html>")); 517 517 end MVcontrol; 518 519 partial block DiscreteBlockIcon 520 "Graphical layout of discrete block component icon" 518 519 partial block DiscreteBlockIcon 520 "Graphical layout of discrete block component icon" 521 521 annotation (Icon(Rectangle(extent=[-100, -100; 100, 100], style(color=3, 522 522 fillColor=52)), Text(extent=[-150, 150; 150, 110], string= … … 524 524 <p> 525 525 Block that has only the basic icon for an input/output, 526 discrete block (no declarations, no equations), e.g., 526 discrete block (no declarations, no equations), e.g., 527 527 from Blocks.Discrete. 528 528 </p> 529 529 </html>")); 530 equation 531 530 equation 531 532 532 end DiscreteBlockIcon; 533 534 partial block DiscreteBlock "Base class of discrete control blocks" 533 534 partial block DiscreteBlock "Base class of discrete control blocks" 535 535 extends DiscreteBlockIcon; 536 537 parameter SI.Time samplePeriod(min=100*Modelica.Constants.eps) = 0.1 536 537 parameter SI.Time samplePeriod(min=100*Modelica.Constants.eps) = 0.1 538 538 "Sample period of component"; 539 539 parameter SI.Time startTime=0 "First sample time instant"; 540 protected 540 protected 541 541 output Boolean sampleTrigger "True, if sample time instant"; 542 542 output Boolean firstTrigger "Rising edge signals first sample instant"; 543 equation 543 equation 544 544 sampleTrigger = sample(startTime, samplePeriod); 545 545 when sampleTrigger then … … 548 548 annotation (Documentation(info="<html> 549 549 <p> 550 Basic definitions of a discrete block of library 550 Basic definitions of a discrete block of library 551 551 Blocks.Discrete. 552 552 </p> 553 553 </html>")); 554 554 end DiscreteBlock; 555 556 partial block DiscreteSISO 557 "Single Input Single Output discrete control block" 558 555 556 partial block DiscreteSISO 557 "Single Input Single Output discrete control block" 558 559 559 extends DiscreteBlock; 560 561 Modelica.Blocks.Interfaces.RealInput u "Continuous input signal" 560 561 Modelica.Blocks.Interfaces.RealInput u "Continuous input signal" 562 562 annotation (extent=[-140, 563 563 -20; -100, 20]); 564 Modelica.Blocks.Interfaces.RealOutput y "Continuous output signal" 564 Modelica.Blocks.Interfaces.RealOutput y "Continuous output signal" 565 565 annotation (extent=[100, 566 566 -10; 120, 10]); … … 572 572 </html>")); 573 573 end DiscreteSISO; 574 575 partial block DiscreteMIMO 576 "Multiple Input Multiple Output discrete control block" 577 574 575 partial block DiscreteMIMO 576 "Multiple Input Multiple Output discrete control block" 577 578 578 extends DiscreteBlock; 579 579 parameter Integer nin=1 "Number of inputs"; 580 580 parameter Integer nout=1 "Number of outputs"; 581 582 Modelica.Blocks.Interfaces.RealInput u[nin] "Continuous input signals" 581 582 Modelica.Blocks.Interfaces.RealInput u[nin] "Continuous input signals" 583 583 annotation (extent=[-140, 584 584 -20; -100, 20]); … … 586 586 annotation (extent=[100, 587 587 -10; 120, 10]); 588 588 589 589 annotation (Documentation(info="<html> 590 590 <p> … … 595 595 ")); 596 596 end DiscreteMIMO; 597 598 partial block DiscreteMIMOs 599 "Multiple Input Multiple Output discrete control block" 597 598 partial block DiscreteMIMOs 599 "Multiple Input Multiple Output discrete control block" 600 600 parameter Integer n=1 "Number of inputs (= number of outputs)"; 601 601 extends DiscreteBlock; 602 603 Modelica.Blocks.Interfaces.RealInput u[n] "Continuous input signals" 602 603 Modelica.Blocks.Interfaces.RealInput u[n] "Continuous input signals" 604 604 annotation (extent=[-140, 605 605 -20; -100, 20]); 606 Modelica.Blocks.Interfaces.RealOutput y[n] "Continuous output signals" 606 Modelica.Blocks.Interfaces.RealOutput y[n] "Continuous output signals" 607 607 annotation (extent=[100, 608 608 -10; 120, 10]); 609 609 610 610 annotation (Documentation(info="<html> 611 611 <p> … … 616 616 </HTML> 617 617 ")); 618 618 619 619 end DiscreteMIMOs; 620 621 partial block SVdiscrete "Discrete Single-Variable controller" 620 621 partial block SVdiscrete "Discrete Single-Variable controller" 622 622 extends DiscreteBlock; 623 623 624 624 Discrete.Sampler sampler_s( 625 625 final samplePeriod=samplePeriod, … … 629 629 final startTime=startTime) annotation (extent=[-10, -100; 10, -80], 630 630 rotation=90); 631 Modelica.Blocks.Interfaces.RealInput u_s 631 Modelica.Blocks.Interfaces.RealInput u_s 632 632 "Continuous scalar setpoint input signal" annotation (extent=[-140, -20; - 633 633 100, 20]); 634 Modelica.Blocks.Interfaces.RealInput u_m 634 Modelica.Blocks.Interfaces.RealInput u_m 635 635 "Continuous scalar measurement input signal" annotation (extent=[20, -100; - 636 636 20, -140], rotation=-90); 637 Modelica.Blocks.Interfaces.RealOutput y 637 Modelica.Blocks.Interfaces.RealOutput y 638 638 "Continuous scalar actuator output signal" annotation (extent=[100, -10; 120, 639 639 10]); … … 656 656 that are sampled due to the defined <b>samplePeriod</b> parameter. 657 657 The block is designed 658 to be used as base class for a corresponding controller. 659 </p> 660 </html>")); 661 equation 658 to be used as base class for a corresponding controller. 659 </p> 660 </html>")); 661 equation 662 662 connect(u_s, sampler_s.u) annotation (points=[-120, 0; -102, 0]); 663 663 connect(u_m, sampler_m.u) annotation (points=[0,-120; 0,-111; 0, 664 664 -102; -7.34764e-016,-102]); 665 665 end SVdiscrete; 666 667 partial block MVdiscrete "Discrete Multi-Variable controller" 666 667 partial block MVdiscrete "Discrete Multi-Variable controller" 668 668 extends DiscreteBlock; 669 669 parameter Integer nu_s=1 "Number of setpoint inputs"; … … 672 672 Discrete.Sampler sampler_s[nu_s]( 673 673 each final samplePeriod=samplePeriod, 674 each final startTime=startTime) 674 each final startTime=startTime) 675 675 annotation (extent=[-90, -10; -70, 10]); 676 676 Discrete.Sampler sampler_m[nu_m]( 677 677 each final samplePeriod=samplePeriod, 678 each final startTime=startTime) 678 each final startTime=startTime) 679 679 annotation (extent=[-10, -90; 10, -70], 680 680 rotation=90); 681 Modelica.Blocks.Interfaces.RealInput u_s[nu_s] 681 Modelica.Blocks.Interfaces.RealInput u_s[nu_s] 682 682 "Continuous setpoint input signals" annotation (extent=[-140, -20; - 683 683 100, 20]); 684 Modelica.Blocks.Interfaces.RealInput u_m[nu_m] 684 Modelica.Blocks.Interfaces.RealInput u_m[nu_m] 685 685 "Continuous measurement input signals" annotation (extent=[20, -100; 686 686 -20, -140], rotation=-90); 687 Modelica.Blocks.Interfaces.RealOutput y[ny] 687  
