**Development of a Multiphysics Real-Time Simulator for Model-Based Design of a DC Shipboard Microgrid**

#### **Fabio D'Agostino 1, Daniele Kaza 1, Michele Martelli 1, Giacomo-Piero Schiapparelli 1, Federico Silvestro 1,\* and Carlo Soldano <sup>2</sup>**


Received: 20 May 2020; Accepted: 5 July 2020; Published: 11 July 2020

**Abstract:** Recent and strict regulations in the maritime sector regarding exhaust gas emissions has led to an evolution of shipboard systems with a progressive increase of complexity, from the early utilization of electric propulsion to the realization of an integrated shipboard power system organized as a microgrid. Therefore, novel approaches, such as the model-based design, start to be experimented by industries to obtain multiphysics models able to study the impact of different designing solutions. In this context, this paper illustrates in detail the development of a multiphysics simulation framework, able to mimic the behaviour of a DC electric ship equipped with electric propulsion, rotating generators and battery energy storage systems. The simulation platform has been realized within the retrofitting project of a Ro-Ro Pax vessel, to size components and to validate control strategies before the system commissioning. It has been implemented on the Opal-RT simulator, as the core component of the future research infrastructure of the University of Genoa, which will include power converters, storage systems, and a ship bridge simulator. The proposed model includes the propulsion plant, characterized by propellers and ship dynamics, and the entire shipboard power system. Each component has been detailed together with its own regulators, such as the automatic voltage regulator of synchronous generators, the torque control of permanent magnet synchronous motors and the current control loop of power converters. The paper illustrates also details concerning the practical deployment of the proposed models within the real-time simulator, in order to share the computational effort among the available processor cores.

**Keywords:** model-based design; HIL; multi physics simulation; marine propulsion; ship dynamic; DC microgrid; shipboard power systems

#### **1. Introduction**

In recent years, complexity and interoperability requirements of industrial products and systems, have seen a significant increase. This has led to new challenges in both design and development of innovative and competitive solutions. High-tech, automotive, and aerospace industries, have been among the firsts to apply a model-based design (MBD) approach, exploiting information technologies and CAD models [1] to assist designers in every stage of the development process [2]. The main idea behind the MBD is the development of a complete system in a virtual environment, to reproduce the expected behaviour of the real system, and to predict its performances before the building. Some examples of MBD application are experienced for propulsion plant control purposes [3,4]. Figure 1a

summarizes the main aspects of the MBD philosophy. More specifically, the workflow can be described in four points: (I) requirements collection; (II) physical system and control definition; (III) verification and validation; (IV) test, performed with hardware-in-the-loop (HIL) setups. As depicted in Figure 1b, these main points are not necessarily sequential, since the continuous verification after each step is the key aspect of the MBD design procedure. Several variations of this general structure are available in literature, e.g., the V-model approach is often used. It consists of an iterative process, typically used for software development and now also for microgrid design, which associates at each development step a specific test phase for validation [5,6].

**Figure 1.** (**a**) Model-based design philosophy [1]. (**b**) Model-based design workflow scheme [2].

In general, the application of the MBD for power system and microgrid studies regards control and protection design and testing [7–9], generation sizing [5] and on-board power systems [10]. In this context the adoption of MBD can support the microgrid design phases [11], which typically are: (1) definition of the system layout and voltage levels, (2) load analysis, (3) generators and storage sizing, (4) distribution system and cables sizing, (5) fault current analysis and protection schemes selection. The availability of a model allows to validate each step in a simulated environment, especially when a microgrid is characterized by heterogeneous generation resources and technologies that increase considerably the system complexity. Finally, HIL configurations introduce additional improvements to the MBD procedure, by allowing the possibility to test real components, such as controllers or protection devices [12,13].

The installation of innovative energy sources [14–17], to reduce harmful emissions as imposed by recent regulations [18–20], has considerably increased on-board system complexity among all the assets of the marine industry. Shipboard power systems have become modern microgrids where complex technologies need to be integrated with high performance requirements. Such a complexity increase has led shipboard power systems designers to consider the use of model-based design techniques to achieve the goals of an efficient and more cost-effective product development in a simple manner [21].

In this paper, a DC microgrid multi-physics real-time model is presented. This work has been developed in the context of an industry project consisting in the retrofit of a roll-on roll-of (RORO) ferry; starting from a conventional diesel propulsion plant a new diesel–electric hybrid system has been designed and successfully tested. The aim of work is the development of a real-time simulation setup in order to support the design of a new microgrid. The ship model, studied and developed for a specific application, considering both electrical and ship dynamics, has been implemented in Matlab/Simulink environment and deployed on Opal–RT simulator [22]. Such a HIL setup , as a future development, will be integrated in a co-simulation environment provided by the ShIL research infrastructure, of the University of Genoa. The ship-in-the-loop (ShIL) research infrastructure is a project developed by DITEN, DIME and DIBRIS departments of the University of Genoa to build up a co-simulation environment power-hardware-in-the-loop (PHIL) in which shipboard microgrid, cyber range and ship dynamic behaviour tests can be driven simultaneously [23]. The project, started in 2020 is co-founded by Regione Liguria.

As it is clearly depicted in Figure 2 the laboratory is equipped with different simulators and facilities. In particular the Opal–RT simulator is connected to a power converter sized 15 kW at can provide an active front-end and a DC bus where it is possible to connect Lithium-ion battery and other DC sources. The ShIL infrastructure is composed of: four-quadrant power converters connected to Opal–RT simulator, storage systems, 5 kW fuel-cell, ship bridge simulator which replicates ship dynamics and human interaction, 5G and telecommunication simulators.

**Figure 2.** Co-simulation enviroment for HIL simulation.

The contributions of the paper are: (I) description of the model-based design methodology in the context of a revamping project of a ferry; (II) presentation of the detailed models of shipboard power system controls and components; (III) description and detailed modeling main propulsion plant machinery and ship dynamics, not usually considered coupled with power system studies [24]; (IV) critical discussion of a real-time HIL setup, developed to allow components testing; (V) integration of multi-level hierarchical controls including automation system and management of different operating modes. The latter, is essential for the integration of the ship bridge simulator in the co-simulation environment and it represents an improvement beyond the state-of-the-art.

The paper is organised as follows: Section 2 presents the main characteristics of the RORO ferry case study, highlighting design choices and requirements for the electrical and the ship components. Sections 3 and 4 describe the system models and control loops adopted. In Section 5, the model deployment in Opal-RT is presented, and results obtained by the real-time simulations are described in Section 6. Finally, conclusions and future developments are discussed in Section 7.

#### **2. Revamping Project Overview**

The case study used to test the proposed methodology refers to a ferry, designed for the navigation in Lago Maggiore (Italy). It is a bi-directional ship with the hull that presents a bow-stern symmetry; two propellers, located at bow and stern region, provide the thrust in both ahead and astern run. This solution is quite common for RORO ships that connects ports close each other, since it reduces the berthing time [25]. The main characteristics of the ship are summarized in Table 1.


**Table 1.** Ro-Ro ferry main dimensions.

The older propulsion configuration is composed of two diesel engines, MTU 12V183 TE62, 310 kW, 1800 rpm, that provide torque to the two independent shaft lines. The ship electrical power supply was provided by a diesel generator, AIFO 8210M 220 V, and by 24 V uninterruptible power supply (UPS) [26,27]. In the target configuration, the diesel engines are replaced by two permanent-magnet synchronous motors (PMSMs) in a microgrid architecture. The shipboard microgrid presents a DC radial configuration organised with two main DC buses, named Fore (FOR) and After (AFT) switchboard, respectively [28]. DC systems are nowadays attractive, specially for low power range [29], since, in respect to traditional AC systems, these solutions may lead to a not negligible reduction of weight and distribution losses, improving in general the system efficiency. On the contrary, DC systems require to deal with problems related to low short-circuit currents, dc-breaker technology, and system standardization [30,31].

The electrical system is symmetric, each main bus presents a diesel generator (DG) connected to the main switchboard with an active rectifier, a battery energy storage system (BESS) interfaced with a DC-DC two quadrants converter, a propulsion system drive, a PMSM and propeller. Additionally, each DC bus bar presents a grid-forming inverter for the supply of the AC distribution system. Both the DC and AC systems are symmetric, and they could be connected alternatively, through a DC tie breaker or an AC tie breaker. Figure 3 shows the system one line diagram.

The power and energy management strategies assumed in the paper are defined in accordance with the project requirements, and tested with a specific mission profile requested by the customer. Component sizing is also defined in accordance with these guidelines, as described in Section 6.4. Nevertheless, the proposed framework can be applied to a wider set of study cases and projects [32].

**Figure 3.** One line diagram.

#### **3. Components Modeling and Control Strategies**

The ferry with the new power configuration, should operates in three different operational modes: full-electric, hybrid and diesel mode. In the first case, the DGs are off and the energy to the propulsion motor is provided by BESSs. In the second case DGs and BESSs cooperates for the power supply while in the third case the BESSs are disconnected and the necessary power is provided by the DGs. In order to fulfill requirements imposed by the different navigation modes, several solutions have been developed. In this work, a DC voltage droop control scheme is considered and adopted when the operation mode requires the coordination of multiple resources (DGs and/or BESSs) [33–35]. Instead, a single DC voltage forming control scheme is used when the operative mode requires only one system providing the DC bus regulation.

Figure 4 shows a synthesis of the higher level control loops of the system. Starting from the DG, the AC voltage is controlled by an automatic voltage regulator (AVR) (IEEE-AC1A) while the speed is regulated by a governor (modelled as a standard Woodward Diesel Governor DEGOV1). The DG is connected to the DC bus through an active rectifier which implements a proportional-integral (PI) DC voltage regulator and a PI *dq*-axis current control, described in the following. Such a system is capable to operate in stand alone DC forming mode or in multiple resources droop control mode.

The BESS are connected to the DC bus via a DC-DC buck-boost converter. According to the different operating mode, the BESS can be controlled in order to regulate the injected current or the DC bus voltage, both in stand alone or droop scheme.

The propulsion system implemented consists of a PMSM supplied by a variable speed drive. The motor should provide the propeller required torque. The motor speed, and consequently the propeller rotational regime, is controlled by an upper level closed loop control cruise control, based on the error between the desired and the actual ship speed, evaluated using a one degree of freedom motion equation [36].

The AC power system is supplied by two grid-forming converters, which can be operated alone or in parallel both in grid-supporting mode [37].

Details on the adopted control strategies for the single devices are reported in the following.

**Figure 4.** Shipboard microgrid main control loops.

#### *3.1. Battery Energy Storage Systems and DC-DC Converters*

The BESS model is realised using a standard Simulink SimPowerSystem (SPS) Li-ion battery model connected to the DC bus thought a DC-DC buck-boost converter, Figure 5a.

Three different control strategies can be selected. The first one, Figure 5b, consists of a PI current control with voltage droop. Specifically, the current reference signal given to the PI current control is calculated as the sum of the current set point *I*∗ *<sup>B</sup>* and the voltage droop error signal, *Kdr*(*V*<sup>∗</sup> *dc* − *Vdc*). Where *Kdr* is the droop coefficient and *V*<sup>∗</sup> *dc*, *Vdc* are the voltage DC bus reference and measured signal, respectively. The duty cycle *δ*, for the pulse width modulation (PWM) is the sum of the PI output signal and the measured battery voltage *VB*. This control mode allows to participate in the DC bus voltage regulation and to implement state of charge (SOC) management strategies. When multiple devices are involved in the DC bus droop regulation, the power sharing, and thus the contribution of each resources, can be controlled by changing the reference current *I*∗ *<sup>B</sup>* [34,38].

The second control strategy, Figure 5c, is a DC voltage forming control. The DC-DC converter is controlled alternatively either as a boost or buck converter. When the bus voltage *Vdc* is lower than its reference value, *V*∗ *dc*, the converter is controlled as a boost, when the previous condition is not respected it is controlled as a buck. The duty cycles, one for each control channel, are defined by a PI regulator.

The third control strategy, Figure 5d, consists of a battery current control. This regulation strategy allows to control precisely the battery output current and it can be used for SOC management strategies.

**Figure 5.** (**a**) Battery DC-DC circuit diagram. (**b**) DC voltage droop control, (**c**) DC voltage forming control, (**d**) battery current control.

#### *3.2. AC-DC and DC-AC Three Phase Converters*

The DG model consists of a standard SPS synchronous machine per unit model. The implemented controls are the governor, Woodward Diesel Governor DEGOV1, and the AVR IEEE-AC1A [39]. The DGs are coupled with the DC bus thought an active rectifier. The rectifier model consists of a three phase converter and a LCL filter in which the output L is realised with a transformer, Figure 6. The rectifier controls consist of a PI feed-forward current control and an outer DC voltage PI control which defines the dq-axis current references. Similarly the two DC-AC converters which provides the power supply to the AC subsystem have been implemented with the same scheme but implement a grid-forming with supporting mode control strategy [40].

The LCL filters for both cases have been designed following criteria detailed in the literature [41,42].

#### 3.2.1. Converter Control Loops

The convert control loops implement a hierarchical control system organization. In this context we call device level controls the PI *dq*- current and voltage feed-forward controls, and system level controls, all the other loops which define the reference for the device level loops according to specific system requirements [43]. In this second group we consider the DC bus voltage regulation in case of the AC-DC active rectifier, and grid-forming control in case of the DC-AC converter.

The device level controls considered in this paper are *dq* PI current and voltage feed-forward controls, Figure 6. The control system design is out of the purpose of the paper. As detailed in literature, the current and voltage control loop can be modelled, considering the system of equation of the LCL filter [44–46]. Thus, control parameters can be defined according to the system eigen values and desired control performance [44,47].

The reference frame for the *dq*-transformation, can be provided by a phase locked loop (PLL) or can be generated internally by the controller according to the regulation strategy implemented by the system level controls. More specifically, power converters can be in general divided into grid following and grid forming units [43,48]. The grid following unit, can operate only with an already energised grid, since it controls active and reactive power by regulating the current output according to the voltage magnitude and phase. The active rectifier, Figure 6a, is a grid following unit. It controls active and reactive powers by properly changing the current *dq* reference in a synchronized way with the voltage phase measured by the PLL. On the other hand, the grid forming unit can be considered as voltage generators. It can control voltage magnitude ad frequency, and thus it can energize an AC grid. The DC-AC converter in Figure 6b is a grid forming unit [37].

**Figure 6.** AC-DC converters single line diagrams: (**a**) rectifier control scheme (**b**) grid-forming scheme.

The diesel genset is connected to the DC bus by an active rectifier, Figure 6a. The AC section is energised by the generator and the converter has to control the active and reactive power in order to regulate the DC and AC voltage, respectively. In this specific application two droop control schemes have been adopted. The *d*-axis current reference is given by the DC current PI controller with DC voltage droop [49,50]. The *q*-axis current reference is given by a reactive power PI controller whose reference is given by AC voltage error multiplied by the AC voltage droop coefficients.

The grid forming converter, Figure 6b, is used to supply the AC distribution system. The adopted control structure is a grid forming with supporting scheme [37,40,48]. The supporting scheme is required if the converter operates in parallel with other units. More specifically, the implemented strategy corresponds to the one presented in [37]. It implements two separate control channels in order to regulate the active and reactive power sharing. The voltage phase, and the frequency, are controlled by the active power channel, which implements the so called reverse droop control applied to the active power error. While the voltage magnitude is controlled by the reactive power channel, which implements the reverse droop on the reactive power error [43]. Additionally, to improve

the performance, the active power channel presents a low-pass filter which is used to avoid fast frequency variations and allows an inertial response, while the reactive power channel implements a virtual inertia control [37]. The adopted control strategy allows the systems to operate in both, AC radial or meshed grid configuration [51]. Notice that the same capability could be obtained even with virtual synchronous machines (VSM) control strategies [43,52].

#### *3.3. Propulsion Plant Dynamic*

The propulsion plant simulator is composed of a PMSM, a propeller, and a DC-AC drive. The motor shaft rotational speed is controlled by a PI, and the vector controller is realized by a current hysteresis control, the layout is reported in Figure 7a. The PMSM is modelled as a standard SPS which receives as input the required propeller torque computed by the propeller model. In order to have a realistic and time-dependant propeller load, the propulsion plant dynamic has been modelled using two differential equations, able to represent the transient behaviour of both shaftline and surge motion. The shaftline acceleration and deceleration are derived by the Lagrange motion equation for rotating rigid body:

$$I\_P \frac{d}{dt} \Omega(t) = Q\_{cm}(t) - Q\_D(t) - Q\_F(t) \tag{1}$$

where: *IP* is the total polar inertia of the system, and it includes motor, shaft and propeller inertia; Ω is the rotational regime; *Qem* is the electromagnetic torque; *QD* = *QO*/*η<sup>r</sup>* is the delivered torque, while *QF* = (1 − *ηs*)*QD* is the torque losses due to friction in bearings and stern tube. For the paper's purposes, both the relative rotative efficiency (*ηr*) and friction coefficient (*ηs*) have been kept constant.

The ship surge velocity (*u*) is obtain integrating the follow equation:

$$(m\_{rb} + m\_{ad})\frac{d}{dt}u(t) = -R\_T(t) + (1 - t\_{df})T(t) - T\_{env}(t). \tag{2}$$

where *mrb* is the ship displacement (Δ), *mad* = 0.08Δ is the added mass, both expressed in kg; *RT* is the ship resistance in N, obtained using CFD methods. *td f* is the thrust deduction factor; *T* is the propeller thrust and *Tenv* accounts for all the environmental forces due to either wind or wave, the environmental disturbances are not considered at the current stage, and they will subject to further investigations in future work.

Several methods are present in literature to evaluate the propeller performance, most of them required a high computational time not suitable to be used in a real-time simulator. For such a reason it has been decided to develop a quasi-dynamic model of the propeller, exploiting the open water diagrams. The open water diagram reports the non-dimensional thrust coefficient *KT*, the non-dimensional torque coefficient *KQ*, their expression are reported hereinafter.

$$K\_T = \frac{T}{\rho D^4 n^2} \tag{3}$$

$$K\_Q = \frac{Q\_o}{\rho D^5 n^2} \tag{4}$$

where, *ρ* is the water density (assumed equal to 1000 kg/m3 since the ship operates in freshwater), *D* is the propeller diameter expressed in m, *n* is the propeller speed in rps (revolution per second). In addition, also the open water efficiency *ηo*, can be assessed as [53]:

$$
\eta\_{\mathcal{O}} = \frac{fK\_T}{2\pi K\_Q} \tag{5}
$$

**Figure 7.** (**a**) Propulsion system layout; (**b**) propulsion plant model; (**c**) propeller open water diagram and (**d**) ship hull total resistance curve.

The open water diagram is shown in Figure 7c. The numerical values of these coefficients, stationary for definition, have been obtained from a 5-bladed Wageningen B series [54] and given in function of the advance coefficient *J*, computed as:

$$J(t) = \frac{V\_a(t)}{n(t)D} \tag{6}$$

$$V\_a(t) = (1 - w)u(t) \tag{7}$$

where: *Va* is the advance speed at propeller plane in m s−1, and *w* is the wake fraction. As it can be seen, the advance coefficient is a time-dependant variable so the propeller transient behaviour is partially catch. Using the previous steps, it is possible to evaluate the last two terms not yet defined in (2) and (1) ,*T*(*t*) and *Qo*(*t*). For reader's clarity, the schematic representation of the whole propulsion model is reported in Figure 7b.

#### **4. Ship Automation**

The ship automation consists of the highest level control of the microgrid. At this level usually operates the algorithm which performs the energy management strategy, mission control and the human–machine interface (HMI). The development of these types of control is out of the purpose of the paper, therefore, in this study, only the minimum possible control loops have been implemented in the system. Nevertheless, the benchmark proposed will be used in the next steps of the retrofit project for testing new control algorithms and interfaces. Thus, the automation system received as command the devices on/off signals and some user-defined setpoints such as ship speed and batteries charge discharge controls. The main inputs and outputs of the implemented automation system are reported in Figure 8.

**Figure 8.** Automation controls.

#### **5. Implementation on Real-Time Simulation Platform**

The practical implementation of the model in Opal-RT is described in Figure 9. The simulation uses the computational power of three cores, the base model is coded in Simulink environment using the SimPowerSystems blockset and the add-on advanced real-time electro-magnetic solvers (ARTEMiS) [55]. The solver is the the state-space nodal (SSN) algorithm, a delay-free solver provided with ARTEMiS [56].

ARTEMiS precomputes and discretizes all the state-space matrix which represents the network and store them into cache memory,in order to simulate the system in real-time. The most switches are in the network the most typologies are possible and therefore the most state-space matrixes need to be stored in cache memory, causing overflows. To overcome this problem, the network is decoupled, into many sub circuits reducing the total size of the state-space matrices in memory [56]. The decoupling is realized in two different ways, the first solution exploits the fact that the transmission lines introduce a natural delay to the propagation of the waves, thus when we deal with long transmission lines, the delay naturally introduced is usually larger than the simulation step size, while in the case of short lines, which provides a delay shorter than the time steps, an additional external delay is introduced, since at the end we get at least one time step delay. The decoupling in the case of short lines is realized with the ARTEMiS StubLines, which are used in the system to divide the network in order to be simulated in parallel on different cores, Figure 9. When there are no transmission lines, a second decoupling method is provided by the state-space nodal (SSN) approach. Specifically, ARTEMiS provides the SSN solver, which combines the state-space approach with the Nodal approach which is able to divide the electrical network into smaller electrical systems without introducing any delay. This second solution for the decoupling is realised by the ARTEMiS SSN blocks which divides the system into sub circuits which can be characterised as inductive group (V-type port) considered as a voltage source connected to an inductive element, or as capacitive group (I-type port) considered a a current source connected to a capacitive element. The system decoupling strategy for the real-time (RT) simulations is shown in Figure 9.

**Figure 9.** Opal-RT implementation.

The simulation step-size has been set to 30 μs and therefore with such a time step we are not able to simulate PWM with high switching frequency. In order to overcome this limitation, PWM signals are generated using the RT-EVENTS toolbox, which is capable to represent the logical state of static switches, whose value can change inside a single simulation time-step. Ten RT-EVENTS have been set for each time step, allowing the correct evaluation of PWM high frequency modulation signals. Nevertheless, in a planned upgrade of the RT simulator an FPGA board will be available for the simulation of power converters at high switching frequency.

In the described configuration the real-time model can be simulated without any overrun, meaning that at each time step the computation time of each step is less than the simulation time-step defined by the user. Numerical results are shown in the following section.

#### **6. Simulation Results**

The performances of the described real-time simulation setup are demonstrated with three different simulations. The first and the second ones aim to test the controls of the DC and AC system respectively. The third one, proposes a simulation of the ship in realistic design condition reproducing the the mission profile that the ship will be facing with. The main parameters of systems and controllers are reported in the Appendix A, Table A1.

#### *6.1. DC Bus Regulation*

All the devices in the microgrid operate to the system regulation which different strategies. Figure 10a shows the results of a simulation in which the different DC bus control strategies are exchanged. In the top graph of Figure 10a, the timeline of the different events is described. The initial configuration considers the two batteries, cooperating in droop control scheme to the regulation of the two DC switchboard connected by the DC tie breaker. Then, the two buses are disconnected, the ships accelerate to a speed of 6 kn and the two DGs are connected to the DC buses. At 180 s the two DC buses are connected again and BESS control test starts. Firstly, some set points are driven to the BESSs which operates in droop control scheme. Then, at 350 s the battery control strategy is changed to current control mode. In this configuration the BESS current is controlled directly and the voltage regulation is left to the DGs. With this control mode some set points are sent to the BESS controllers

and finally at 500 s the BESS droop control strategy is restored. For the last tests, the two DGs and the FOR BESS are disconnected. In this configuration, the AFT BESS is the only resources left to feed the propulsion system in voltage forming control mode. Below of the time line plot in Figure 10a, some measurements are shown, such as, DC voltage at the two main busbars, batteries current and state of charge, generators speed and voltages and finally, generator powers.

**Figure 10.** (**a**) DC and (**b**) AC control system tests.

#### *6.2. AC Bus Regulation*

The performance of the AC regulation system are shown in Figure 10b. The timeline in the top graph, summarize the commands sequence. Initially, the DC tie breaker is in state off, then, the two DC-AC grid forming converters are activated and the AC grid is energised. At this stage the grid is operated completely separated from starboard to port side, both AC and DC tie breakers are open. At 160 s the AC tie breaker is closed, and the two side of the grid are connected. At 160 s the DC tie breaker is also closed and the grid pass from a radial to a meshed configuration. Finally, the AC tie breaker is operated in order to disconnect the two AC grid, the port side converter is turned of and the DC tie breaker is closed again in order to reach the configuration in which all the AC supply is given by the only starboard side converter. Below of the time line plot in Figure 10b, DC voltage, AC voltage and AC frequency are shown.

#### *6.3. Ship Mission*

The whole system performance has been finally evaluated by simulating a realistic navigation of approximately 5 nautical miles between the port of Intra and the port of Laveno on Lago Maggiore, Italy. The mission considers a round trip of almost 1 h and it is described in the top graph of Figure 11. Specifically, mission starts in port of Intra, the ship is moored and the power system is supplied only by the two batteries with a SOC equal to 50%. After few seconds, the navigation starts; the engine set point is set to obtain 6 kn, and this speed is kept constant for almost 300 s, the time needed to reach a sufficient distance from the coast and to switch to hybrid mode. Thus, one diesel generator is turned on, the battery set-points are set 128 A (recharge), and the ship speed is increased up to 10 kn. After almost 23 min of navigation, with the DG running smoothly at half load, the ferry is close to the arrival port

of Laveno, thus the battery recharge is stopped with a SOC about of 60% (suggested value by the manufactures to extend the life cycle), the diesel genset is turned off, and the ship starts the manoeuvre to enter the port in full electric mode with a speed of 6 kn. Once the port is reached, the ship is moored and after a while the way back trip starts, following the same procedure described before. For sake of completeness, in the lower sub-plot the ship speed and the propeller thrust are reported, pointing out a symmetric behavior, without any peak. Some simulation results for the shipboard power system are shown in the plots of Figure 11.

**Figure 11.** Simulation of a navigation mission between port of Intra and port of Laveno, Lago Maggiore, Italy.

Figure 12 shows the real-time simulator core monitoring outputs provided by the OpMonitor block [55]. The yellow line refers to the time step size, the time set by the user in which the simulator has to complete a cycle of measurements–computation–commands [55]. The blue line represents the number of overruns, meaning the number of times in which the time of computation exceeded the defined time step. The red line corresponds to the effective computation time, and the purple time corresponds to the time idle, meaning the difference between the step size and the computation time. As it can be seen, the simulation results to be stable, the systems is able to keep the real-time for all the mission duration. The overall loading is 49.65% of the total computation power, divided as 35.30% for core 1, 34.77% for core 2 and 78.88% for core 3.

*Energies* **2020**, *13*, 3580

**Figure 12.** Real-time setup performance monitoring during the mission simulation.

#### *6.4. Observations on the Ship Management Strategies*

The mission simulation proposed in the previous section refers to the operating mode requested by the customer. Specifically, the project requirements impose (I) to be able to operate in full electric mode below 6 kn, (II) to operate the batteries between a minimum and maximum SOC in order to extend their expected life, (III) to operate in hybrid mode, with one diesel genset as main supply at cruise speed of 10 kn. Moreover, (IV) no shore connection capability is considered, thus, batteries should be kept within the limits during all the operating time and even during the time at berth. Nevertheless, other control strategies could be applied in order to improve the system efficiency [32].

#### **7. Conclusions**

The paper presents the development of a real-time simulation framework of a DC shipboard microgrid, realized to support the retrofitting project of a RORO Pax vessel with a model-based design approach. The shipboard microgrid model shows its capability to reproduce real operating conditions including ship dynamics within the electrical power system study. Models include propellers, prime movers, electrical machines, battery energy storage systems, power converters and regulators. The proposed architecture has been realized to allow hardware-in-the-loop configurations.

Results show that several control schemes can be implemented, to test system performances under different conditions, and to verify operational constraints during the expected ship missions. Moreover, since the simulator has been developed following a modular and parametric approach, it can be continuously tuned with experimental data to improve results fidelity, and to realize the digital twin of the ship during its entire life cycle.

Future works will regard the experimental validation of simulation results, the implementation of the shore connection, and the inclusion of protection devices for short-circuits studies .

**Author Contributions:** Conceptualization F.D., D.K., M.M., G.-P.S., F.S. and C.S.; methodology F.D., D.K., M.M., G.-P.S., F.S. and C.S., investigation G.-P.S., D.K., C.S.; supervision F.D, M.M., F.S. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Appendix A**

The main parameters of the implemented real-time model are listed in Table A1.



**TableA1.**Mainparameters.

#### 69

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
