The term mechatronic is commonly used for systems consisting of both mechanical and electrical parts, i.e. a special kind of multi-domain system. An electric motor is a common example of such a system, and a DC-motor (DC = Direct Current) is the simplest kind of electrical motor.
Modeling a DC-motor illustrates the ease of constructing multi-domain models in Modelica simply by connecting components from different domains. This particular model contains components from three domains: mechanical components such as inertia1, the electrical components resistor1, inductor1, signalVoltage1, and ground1 as well as pure signal components such as step1.
A multi-domain DCMotorCircuit model with mechanical, electrical andsignal-block components.
IMPORTANT: To simulate the DCMotorCircuit model, you first need to select all group cells containing all needed models below, and push shift-return.
The DCMotorCircuit class is declared below. What is different from previous examples is that certain connections couple components from different domains, e.g. the signal block step1 is connected to the electrical component signalVoltage1 and the electrical component emf1 is connected to the mechanical component inertia1.
To avoid confusion with the translational Flange_a connector class we have renamed the rotational flange connector class to be called RotFlange_a in this example, even though it is called Flange_a in Mechanics.Rotational.Interfaces library. Connectors have the same names as their classes apart from the first letter being lower-case, and a number being appended at the end.
In the following we present the DCMotorCircuit model including its parts and used classes in roughly a top-down manner, with the most interesting parts first. This gives the best overview and is also fine from a Modelica language point of view since classes can be used before they are defined.
The DCMotorCircuit model contains instances of mechanical, electrical and signal classes, which are declared below.
The Inertia class models the behavior of rotating masses. It inherits some properties from the base class Rigid.
The EMF class below converts electrical energy to rotational mechanical energy. The instance emf1 of class EMF (Electro Magnetic Force) is probably the most interesting component in the circuit since it converts electrical energy to mechanical rotational energy. This class is an idealized model of the most important properties of a voltage-to-rotation converter excluding resistance, inductance and inertia.
The rest of the declared classes are the usual simple electrical components which are presented once more for completeness.
The signalVoltage class converts an input signal to a voltage. This is used in the DCMotorCircuit to convert a step signal generated by the step1 instance of the simplified Step class below to a step voltage. The full version of the Step class that can handle any number of input and output signals. The combination of the step1 and signalVoltage1 components is a voltage generator that feeds a step voltage into the rest of the circuit. The partial class MO is simply a base class inherited by Step.
The following are different types from the library Modelica.SIunits used by the DCMotorCircuit model.