System Level Simulation of Microgrid Power Electronic Systems

In this paper, we describe a procedure for designing an accurate simulation model using a price-wised linear approach referred to as the power semiconductor converters of a DC microgrid concept. Initially, the selection of topologies of individual power stage blocs are identified. Due to the requirements for verifying the accuracy of the simulation model, physical samples of power converters are realized with a power ratio of 1:10. The focus was on optimization of operational parameters such as real-time behavior (variable waveforms within a time domain), efficiency, and the voltage/current ripples. The approach was compared to real-time operation and efficiency performance was evaluated showing the accuracy and suitability of the presented approach. The results show the potential for developing complex smart grid simulation models, with a high level of accuracy, and thus the possibility to investigate various operational scenarios and the impact of power converter characteristics on the performance of a smart gird. Two possible operational scenarios of the proposed smart grid concept are evaluated and demonstrate that an accurate hardware-in-the-loop (HIL) system can be designed.

challenges in the distribution grids [11,12]. Encouraged by attractive tariffs and promotional policies, the end-consumers in the local grids are not only consumers of electricity but in many cases also producers. The actual electric distribution system limits the penetration of renewable energy resources and is based on a unidirectional information flow from sources to control centers. With a gradual deployment and a combination of various energy sources with the possibility of cooperation with the public grid, the development of so-called intelligent or smart grids has been started. Power electronics solutions in the latest technologies can control the electric power flow in a wide range of conditions, and therefore have made the implementation of the widely discussed concept of smart grids possible [13][14][15].
Therefore, smart grid (SG) networks are suitable in cases where many generators (traditional power plants), storage tanks (supercapacitors and EVs), or domestic microgrids are connected to the network, as well as where a two-way flow of energy is required and where the management of energy flows is necessary in order to achieve a goal (for example, economic profit). With the help of SG networks, we can also ensure a significant reduction in transmission losses by moving energy over short distances, which leads to a reduction in conductivity losses. Figure 1 shows an example of a home SG network model with its own DC microgrid (unidirectional intermediate circuit) and an intelligent electronic transformer. The domestic microgrid also contains energy accumulators in the form of lead-acid accumulators and a domestic hot water (DHW) tank. Some devices can also be connected directly to a DC microgrid if they are adapted to do so. The sources of renewable energy in the network are amorphous photovoltaic panels and, in the future, we can also consider electric car batteries as a source/storage of energy [16].  From the abovementioned description, it is evident that smart grids and their future concepts represent complex systems composed of many power semiconductor systems. In addition, it should be noted that a major challenge in the proper operation of such systems is the optimal management and mutual communication within the smart grid subsystem if various energy flow control plans are considered [17]. A common way to investigate and research different operational schemes of SG is to utilize a hardware-inthe-loop simulation approach. It allows us to use the advantages of rapid prototyping, flexibility, and versatility with no potential risk of harming the hardware, because the entire power stage (power semiconductor converters, energy storage systems, etc.) of a smart grid is substituted using equivalent computer models. In this way, it is possible to eliminate time-consuming reconfigurations during testing, or increased costs during system developments [18]. However, the limitation of HIL modeling is the lack of real behavior and impact of equipment that is usually hard to fully capture in a simulation environment [19]. Therefore, the potential for studying HIL modeling of smart grids is using a combination of advanced validation techniques interfacing the real and virtual environments, i.e., real-time simulation, hardware-in-the-loop control, and power stage representation reaching real physical behavior of modeled systems [20][21][22].
In this paper, we describe a proposed design for an HIL model of a smart grid, mainly aimed at developing highly accurate simulation models of individual smart grid system components, with the requirement that the calculation speed must be as low as possible. Such an approach should enable researchers to investigate various concepts of operational scenarios of SG even if standard PC technology is used. Therefore, we have designed a simulation of the power stages of a SG, and we validated the modeling approach using experimental measurements. The proposed model is evaluated by comparing it with realtime behavior (time waveforms of circuit variables) together with an evaluation of the accuracy of qualitative system indicators such as efficiency. Initially, a circuit description of individual power converters for DC microgrid subsystems (i.e., photovoltaic maximum power point tracking (MPPT) converter, bidirectional DC-DC converter, and grid inverter) is modeled using a piecewise linear electric circuit simulator (PLECS) simulator. The results of time-waveform operations are compared to experimental samples of converters, while to verify the accuracy of the HIL models, the efficiency of simulation models and experimental samples are compared for a wide operational range. At the end of the paper, the HIL simulation model of the proposed SG is given. Two operational scenarios regarding SG power flow are initially tested as an example of the potential use and possible analyzes of the proposed modeling approach. The main contribution of the presented research is also represented by the methodology of the modeling, which utilizes simplified piecewise linear electrical circuit models of the power stages, which is beneficial if the computation speeds of SG complex simulation analyses are provided (i.e., various operational scenarios of power flow).

Description of Considered Microgrid Concept
A principal block diagram of the proposed microgrid is shown in Figure 2. The block diagram is proposed for the standard installation of PV panels and an energy storage system of the household, which reflects a power level of approximately 10 kW. The presented concept consist of the following main functional blocks:  Photovoltaic cells;  MPPT DC-DC converter;  Energy management block;  One-phase inverter;  Energy storage block;  Bidirectional DC-DC converter for energy flow control from and into the energy storage system;  Control and communication block.
The converters, which are used for the investigation of accuracy comparisons between experimental and simulation models, are an MPPT converter as well as a bidirectional buck/boost converter that are located between DC bus and energy storage elements [22][23][24]. Because of the laboratory conditions, the ratio of the input to output parameters is 1:10 as compared with a real system. In the next section, we describe the evaluation of the properties of individual power converter alternatives.

Maximum Power Point Tracking (MPPT) Converter Solution
The main task of the MPPT converter within the proposed microgrid is to convert the fluctuating DC voltage obtained from photovoltaic panels to a stable DC voltage. The MPPT algorithm, i.e., the algorithm for achieving the highest possible panel performance, is implemented in the inverter control system if HIL is considered. The most common and simplest solution for the mentioned application is a traditional boost converter, which, in addition to its simple design, also provides very high efficiency (with a synchronous rectifier of up to 99%). For higher outputs (of the order of kW, MW), the structure can be supplemented by other identical converters (1 to n), and then the individual converters work with a phase shift (interleaved). By using an interleaved topology, we obtain lower output voltage ripple, lower input current ripple, and a smaller overall drive volume, but at the cost of design complexity, more complex control, and potentially higher costs [23]. Figure 3 depicts an improved dual interleaved converter by implementation of flux reset circuitry within the main topology [19][20][21]. It consists of additional inductance and output diodes. All three inductors must be wound on one magnetic core. The PWM signals are phase shifted by 180° and the pulse width range can be from 0% to 90% (dependent on the inductor construction). The inverter achieves a high voltage gain (higher than a traditional boost converter) with high efficiency (up to 96%). In addition, the voltage gain can also be changed by the ratio of the turns (inductances) of the coupled inductor, while it must be valid that N1 = N2 : N3. A detailed study regarding this topic is available in [25][26][27].  Table 1 shows that the improved dual interleaved converter has the best efficiency as compared with the individual alternatives, even the number of semiconductor switches is doubled. The improvement in efficiency is related to the type of magnetic component used, i.e., the improved converter uses a much lower magnetic core and utilizes a reset winding that eliminates saturation of the core as compared with the alternative solutions. Due to the low output voltage ripple, the output electrolytic capacitors can be reduced, i.e., their value is much lower as compared with standard topologies. In this way, the optimization results in the reduction of ESR (Equivalent Series Resistance), and thus other losses. A second issue related to efficiency improvement is the benefit of the proposed magnetic design of the inductor due to the fact that it operates as a rigid voltage transformer with the given transformer ratio (coupling coefficient must be very high). This subsystem of the considered microgrid provides a bidirectional interface between the DC link and the energy storage system (ESS). It provides charging/discharging of the batteries depending on the selected power delivery or based on a predefined battery state of charge control. The principle of the operation is simple and is based on using a traditional step-up converter with a synchronous rectifier. The modified circuit enables bidirectional energy transmission and its correct operation is already the task of a suitable control circuit. The converter has excellent efficiency (up to 98%), but its use is possible only in the case where galvanic isolation between the primary and secondary part of the circuit is not required. If high power operation is required (~10 kW) an interleaved solution is preferred [28,29].
For the purposes of the analyses of the considered DC smart grid concept using HIL and in relation to the design of the microgrid´s ESS power converter system, the focus is on an evaluation of the properties of a dual interleaved bidirectional buck-boost (Bi-BB) converter as the non-modular topology ( Figure 4).

Alternatives for DC Link and AC Grid
The interface between the DC microgrid and the AC distribution grid is represented by a three-phase inverter ( Figure 5). It ensures the flow of produced energy from the DC microgrid towards the AC distribution system, depending on the selected energy flow control plan. The inverter's control system should allow the compensation of reactive power components so that the production of quality energy is achieved with the lowest possible content of harmonics and other interfering signals. A conventional full-bridge inverter has been selected for the DC/AC inverter part, which provides enough parameters for the use within considered application.

Evaluation of the Accuracy of the Hardware-in-the-Loop (HIL) Simulation Models
At this point, the focus is on the evaluation of the individual converter´s simulation models, while the maximum power point tracking (MPPT) converter is modeled as a dual interleaved boost with magnetic flux reset circuitry. Secondly, the bidirectional converter is also evaluated; here, a nonmodular dual interleaved bidirectional converter is considered. The accuracy of the proposed simulation approach is verified through experimental measurements, whereby the relative error is calculated for the case of bidirectional converters.

Evaluation of the MPPT Converter
For the first performance investigation between a simulation model ( Figure 7) and an experimental sample (Figure 6), the perspective MPPT converter with coupled inductors and a flux reset circuit is evaluated. As previously mentioned, each converter of the proposed DC-microgrid concept is modeled in a PLECS simulation. To increase the accuracy of the simulations, the thermal and magnetic domains are defined for each model. Instead, the selected semiconductors of the converter prototypes have been modeled using their loss models (Figure 7). With this approach, it is possible to achieve accurate behavior of the circuit schematics which are modeled within a linearized approach [30,31]. The input to output parameters of the physical sample of MPPT converter are as follows (these parameters have also been defined for the simulation model):   As shown in Figure 7, the designed model also uses the MPPT algorithm control together with models of photovoltaic panels. Here, it must be noted that this concept is also utilized within HIL, while for the investigation of the model´s performance, the input part of converter was replaced by a DC input source, as in laboratory experiments [28]. Figure 8 shows the waveforms received from experimental measurements of the proposed converter. The focus was on the waveforms of the coupled inductor and magnetic flux reset circuit. For each coil, the waveforms of currents and voltages are depicted for one switching cycle at nominal load and steady-state operation.  Figure 9 shows the results from the simulation experiments. Similarly, previous situation waveforms for inductor currents and voltages are analyzed. By comparing those results, it is seen that the shapes and character of voltages and currents within the inductors are the same as for the experimental measurements. Therefore, the simulation model's suitability is effective for the HIL modeling purposes. The results support that magnetic modeling, together with proper thermal models of the semiconductors, offers high accurate results.

Evaluation of the Energy Flow Control Converter
The main circuit specifics for the non-modular solution are listed below. The  Figure 10 shows a physical sample of the proposed Bi-BB converter. The nonmodular concept uses inductors that are made on PQ40 N87 cores, while winding is made of isolated copper foil in order to achieve low conduction losses. To secure the safety of control system and PWM generator, together with other system components, the isolation on the side of gate drivers is used. First, the non-modular solution is evaluated. The simulation model used for the verification of the operation is shown in Figure 11. The thermal performance together with magnetic components modeling are designed according to parameters of the physical sample. In addition, the semiconductor devices use exact data of the losses received from manufacturer's datasheets, while the main circuit also contains parasitic components (resistances and inductances of printed circuit board (PCB) traces, leads, etc.) [32].  Figure 12 shows the comparisons of operational waveforms of the non-modular Bi-BB converter and the experimental measurements and simulation results, while nominal power was considered. The data generated from the oscilloscope show inductor currents, while the AC coupling was adjusted. The converter operates in continuous conduction mode. The simulation result shows similar waveforms; thus, inductor currents are evaluated. It can be observed that, when the converter operates under continuous conduction mode (CCM) conditions, if the experiments are compared, the amplitudes (peak to peak) and character of currents are the same.   As was previously mentioned, an additional evaluation of simulation model accuracy was conducted by comparing the efficiency characteristics of the Bi-BB converter operated in boost and buck modes. Because the experimental evaluation of efficiency is a complex task, it requires expensive laboratory equipment. The details of the experimental set-up for the measurements are shown in Figure 14. Figures 15-18 show comparisons between the simulation and measurement sample for evaluating the efficiency parameter and, consequently, the relative error is identified.
The buck and boost modes of operation were both tested. The experiment was conducted for a wide range of output power of the converter, i.e., within 10-100% of the power.  Figure 15 shows the comparison of the efficiency characteristic for the boost model of operation together with the evaluation of relative error for each power level. The results indicate that the simulation model exhibits lower accuracy for the power loads from 10% up to 50%, while the error is within 6-2.5%. Above 50% of the power load, the relative error drops to approximately 1% up to 100% of power.  Figure 16 shows the efficiency comparison between the simulation and measurement samples, while the proposed Bi-BB converter was operated in buck mode. Here, the evaluation of relative error was also realized for the total spectrum of output power. The results are similar to the previous experiment, i.e., the values of relative error vary between 2.5% and 7% up to 50% of the output power, while above this value, the relative error drops to approximately 1% for full power load. The relative error of the efficiency characteristics for both modes of operation ranged from 0 to 7%. The relative deviations of the simulation and experimental results are caused by various parasitic parameters that influenced the physical samples of the converter. These parasites are, for example, DC resistances of component leads, DC resistances of printed circuit boards, resistances of magnetic components, parasitic capacitances of PCB and used components, etc. Most of these components exhibit high thermal dependency, i.e., the values change based on the temperature variation. These effects cannot be simply included within the proposed model, because the level of complexity increases significantly, and therefore is not appropriate for HIL modeling. Another possible source of deviation can be the piecewise linear electric circuit simulator (PLECS) simulation software, which uses simplified linearized component models to simplify and speed up calculations. This means that it is possible to increase the speed at the cost of accuracy reduction. In the case of a physical sample of a non-modular solution, there are several unfavorable factors, such as the use of PCBs with a thin thickness of copper layer, as well as suboptimal implementation of coils that had a low number of turns which causes saturation at full load of the converter. It was not possible to wind many turns on the core due to the thickness of the copper foil. If an optimal coil design is used, the efficiency of the converter could be increased, especially in the power load range of 0-50%.

HIL of the Proposed Smart Grid Concept and the Test of Possible Operational Scenarios
After experimental verification of the parameters of the constructed physical samples of converters, a simulation analysis of the complex microgrid system (Figure 2) within the PLECS simulation software was constructed. The simulation parameters of the individual power converters were adjusted according to the real microgrid system to ensure the highest possible substantiality, i.e., each of the verified converters was reconfigured for higher power (10 kW of the peak operation).
The main contribution of the presented approach is to show the advantages of a piecewise linear electric circuit simulator for modeling of complex power semiconductor systems. Previously, it was shown that with the use of relevant magnetic and thermal domains, satisfactory accuracy of simulation models could be achieved. Therefore, next, the presented approach is validated through a simulation of microgrid operation. To investigate the behavior of the proposed microgrid concept, two operational scenarios were proposed, and are described in Subsections 4.1 and 4.2.

Operational Scenario 1
The first operational scenario is graphically depicted in Figure 17. Considering a photovoltaic energy source, 100% of the sunlight is initially assumed, thus, full power (10 kW) is being supplied. The MPPT converter supplied DC variables to DC bus (Figure 17), while half of the power was supplied to the grid inverter (requirement from consumer) and the second half of the power was transferred through the Bi-BB converter into the energy storage system (full capacity 40 kWh initially charged at 50% of full capacity). In this case, there are no dynamic changes at the inputs or outputs. The principle of the operation of the supervising control system modeled within PLECS is described in Figure  18 for Scenario 1.  The requirement for a DC/AC inverter (5 kW) is half of the energy converted by the photovoltaic panels. The setpoint for the DC bus voltage of the microgrid is 600 V. This value is compared with the actual value and enters the voltage regulator ( Figure 18). Next, there is a reference current limiter, from where the signal is compared with the actual value and continues to the current regulator for the bidirectional converter. The ʺGlobal ENABLEʺ signal is also fed to all subordinate control systems, which evaluates the voltage and undervoltage of the DC microgrid, and in the case of exceeding any limit, the entire system is switched off [33]. Figures 19-21 show the main operational variables of the investigated DC microgrid, i.e., ESS current, DC bus voltage, and DC bus sourced current feeding the grid inverter, which is represented by AC grid voltage and the current. The evaluation of the qualitative indicators of the DC microgrid concept, for example, efficiency, power factor, voltage, and current ripples, is listed in Table 2. It can be seen that, for this operational scenario, the system efficiency reaches 54%. This result is highly affected by the power loading of the grid inverter, in addition, total harmonic distortion of the grid current reaches 4.3%. It must be noted that the experiments have been provided for resistive-inductive load.
Therefore, it could be assumed that the proposed model should be further improved through the investigation of the various types of loads within the AC grid, including the influence of power factor correction circuits.

Operational Scenario 2
For the second operational scenario (Figure 22), it is assumed that 50% of the available power is sourced from the MPPT converter and photovoltaic panels into the AC grid. The remaining power required by the grid is supplied from the energy storage system. In summary, 5 kW is supplied by renewable sources and 5 kW by energy storage system, and thus 10 kW are sourced within the supply grid. The principle of the operation of the supervising control system modeled within PLECS is illustrated in Figure 23 for Scenario 2.  The requirement for a DC/AC inverter is 10 kW. The setpoint for the DC bus voltage of the microgrid is again 600 V. This value is compared with the actual value and enters the voltage regulator ( Figure 23). Next, there is a reference current limiter, from where the signal is compared with the actual value and continues to the current regulator for the bidirectional converter. The ʺGlobal ENABLEʺ signal is also fed to all subordinate control systems, which evaluates the voltage and undervoltage of the DC microgrid, and in the case of exceeding any limit, the entire system is switched off. Figures 24-26 show the main operational variables of the investigated DC microgrid, i.e., ESS current, bidirectional converter inductor currents, DC bus voltage ,and DC bus sourced current feeding the grid inverter, which is represented by the AC grid voltage and current as well. The evaluation of the qualitative indicators of DC microgrid concept, for example, efficiency, power factor, voltage, and current ripples, is listed in Table 3. From the achieved results, it is seen, that system efficiency from source to the load reaches approximately 77% for this operational scenario. These results are better as compared with the results from Table 2. The results are influenced by the efficiency performance of the Bi-BB converter as well as by the efficiency of the MPPT converter, which operates at 50% of the power load. For that operational point, the efficiencies are lower as compared with full power of the converters. If the proper control algorithm regarding power sharing is used, the efficiency for the presented operation scenario could be improved, therefore, the proposed HIL model should allow us to identify the most proper operational point.

Discussion
In this paper, the procedure of the HIL modeling referred to as the power stage of the smart grid was discussed. The main focus was the development of high-precision simulation models of individual power converters belonging to an SG concept, while a piecewise linear electronic circuit simulator is used.
The main benefits of using a piecewise linear simulator are the possibility to model complex power electronic systems and to analyze their behavior as a real-time system within an acceptable simulation time. The presented approach considered the physical properties and processes which cannot be omitted if high accuracy of a simulation model as compared with a physical model is required. In this study, we consider thermal processes, magnetic properties, and nonlinear behavior of inductive components, or power semiconductor devices modeling. All the mentioned regularities were considered and confirmed by experimental comparisons. The results indicated that the simulation models of individual power semiconductor converters exhibited very high accuracy if real-time operation is considered, or efficiency evaluation is performed. Since the demands on calculations in such cases are significantly lower than in nonlinear systems, it is assumed that the presented procedure can reliably model complex power semiconductor systems such as a smart grid. The presented operating scenarios represent an introduction to a possible comprehensive investigation of the operation of SGs regarding the influence on qualitative indicators of a SG, if we consider the characteristics of power semiconductor converters. Our results should be considered in future studies, with the main focus of investigating the supervision control algorithms for targeting the highest efficient operation of DC microgrids.

Conclusions
On the basis of our results, we have confirmed that even with the use of linearized approximated models, high accuracy of simulation results can be achieved as compared with experimental measurements. We described our investigation in detail and the results were verified through a designed perspective dual interleaved converter with a demagnetization circuit and a dual interleaved buck/boost bidirectional converter; both converters were experimentally tested and analyzed. Consequently, simulation models of both converters were developed, and the circuit variables were compared to experimental waveforms. We found that the simulation models showed high accuracy considering operational waveforms. This achievement was also verified by comparing the efficiency performance of the experimental measurements and simulation. We found that, above 50% of nominal power, the relative error between the simulation and experimental measurements was lower than 1%.
We have proposed the design approach for modeling of a smart grid system. A characteristic feature in terms of modeling is the possibility of investigating the impact of the operating characteristics of individual semiconductor converters within the SG, and therefore it is also possible to investigate the influence of possible topological variations within the power stage of a SG. For example, in the analysis of SG operation, the main circuit variables are evaluated, as well as their ripples, and the efficiency of the energy system for a given operating scenario. The presented results are valid for a DC microgrid system with 10 kW of power capability. If systems with significantly higher power ratings are to be modeled, a possible limitation of the presented methodology is the lack of a simple verification method for simulation models with physical prototypes because of the lack of laboratory infrastructure and equipment for high-power level design and measurement.