A connector is a Modelica class with the objective of interfacing two or more components/objects together. This said, one of the areas with higher relevance in Dymola is the connectors since they are the means that let the information flow through every component and therefore allow the model objects to be interfaced correctly.
There are three main types of connectors that can be used depending on the application; Hierarchical, Expandable and Conditional.
Connectors nested within other connectors to enable connections at either the top or sub level.
Connectors which provide a flexible and tidy way to build signal buses to transfer information between subsystems.
Connectors which include or exclude instances of classes for a given condition by the use of boolean parameters.
The central topic of discussion of this blog post is going to be focused on Expandable Connectors. In order to replicate and explain the procedure to establish a connection employing these connectors, a model of an electric motor and its controller are used as an example. Using the same example, the differences among the conventional and expandable connectors are also reviewed.
The expandable connectors used in this example comprise of 3 busses. The controlBus and two sub-busses, the electricMotorBus and the electricMotorControlBus.
The following procedure has to be followed to create a connection using expandable connectors (considering the electric motor model as reference):
- First, the 3 busses previously mentioned have to be dragged into each system (controllerWithBus and electricMotorWithBus).
- At the experiment top level, all the controlBus instances should be connected.
- In every subsystem both the electricMotorBus and the electricMotorControlBus have to be connected to the matching sub-bus within the controlBus connector.
- The convention is such that: the sensors should be connected to the electricMotorBus and the actuators to the electricMotorControlBus.
- When connecting the sensors and actuators signal outputs/inputs to a bus, if the variable to connect to does not already exist on the bus a variable has to be defined for each signal to complete the connection.
Additionally, different blocks were included in the model to receive feedback and to corroborate the results regarding the temperature, current and voltage sensors.
As a conclusion, when comparing the two types of connectors it can be seen that the most notorious advantage of the expandable connectors over the conventional ones is the ease of managing a higher number of connections in a tidier and clearer way. This feature is crucial when designing complex models such as vehicle tests with a considerable number of systems, subsystems and components all interconnected with each other.
On the other side, the biggest advantage of conventional connectors is the simplicity of building a connection by just “click and drag”. A really useful characteristic when designing lower level of complexity models.
Written by: Jose Miguel Ortiz Sanchez, Project Engineer