Energy Management and Control System Design of an Integrated Flywheel Energy Storage System for Residential Users

This paper presents the energy management and control system design of an integrated flywheel energy storage system (FESS) for residential users. The proposed FESS is able to draw/deliver 8 kWh at 8 kW, and relies on a large-airgap surface-mounted permanent magnet synchronous machine, the inner rotor of which integrates a carbon-fiber flywheel, leading to a compact and efficient FESS. The proposed energy management system is based on four different operating modes, which are defined and can be selected in accordance with FESS speed and/or user’s preference, while FESS control system is devoted to power/current tracking at both machineand grid-side converters. The effectiveness of the proposed solutions, as well as the overall energy performance of the proposed FESS, are verified by real-time simulations, which regard different operating conditions and/or realistic scenarios.


Introduction
Distributed energy resources (DERs) have experienced a massive and generally uncontrolled growth in the last few decades, especially low-size photovoltaic (PV) power plants installed by residential users and directly connected to distribution networks [1,2]. If, on the one hand, this enables a less dependence on fossil fuels, increasing environmental and energy sustainability of modern power systems, on the other hand it causes several issues to power system management [3,4]; this historically relies on a hierarchical and concentrated structure, namely few and big thermal power plants connected to the transmission networks, while most of the users draw energy at the distribution level. Consequently, a significant amount of PV energy injected by a multitude of prosumers may have a negative impact on voltage/frequency regulation and power quality due to intermittency and unpredictability of PV production [5][6][7].
In this scenario, energy storage systems (ESSs) play a fundament role in the transition from actual to modern power systems as ESSs can cope with the randomness of renewable energy sources [4,[8][9][10]. In particular, ESS can provide several power and energy services depending on its size and inherent features (dynamic response, rated power and energy, calendar and cycle life, etc.). Electrochemical batteries are surely the most popular solutions for residential prosumers, as proved by a number of ESSs already on the market [11,12]; batteries guarantee adequate power and energy performance, flexible power to capacity ratio, low maintenance, small dimensions and weights, and good modularity [13]. On the other hand, batteries suffer from relatively low cycling capability and aging effects, which may significantly reduce their expected lifetime depending on their usage and environmental conditions [14]. Increased cycling capability can be assured by supercapacitors [15], which, however, are characterized by a very weak energy density, making them suitable for uninterruptible power supplies and, generally speaking, for power services mostly [16].
A viable alternative to both batteries and supercapacitors is represented by flywheel ESSs (FESSs) [17][18][19][20][21][22]; these devices are generally characterized by a high power density, superior to that of electrochemical batteries and comparable to that of supercapacitors, and by a fair energy density, less than batteries but much greater than supercapacitors [19,23]. Furthermore, FESSs are characterized by a very long lifetime and cycling capability (several hundreds of thousands of cycles compared to the few thousands of batteries), and they are maintenance free and environmental-friendly [4,19,20]. On the other hand, FESSs are technologically complex, namely they are made up of several mechanical, electromagnetic and electronic components (electrical machine, power electronic converters, sensors, bearings, etc.), thus requiring expert knowledge in different fields to be designed and manufactured appropriately [22,24,25], this, along with high capital cost, represents the main drawbacks that is still preventing FESS to be widespread, especially for lowmedium size applications [20,22].
FESSs can be classified in accordance with different criteria, among which the most popular concerns their speed range [20,26]. In this regard, low-speed FESSs rotate up to approximately 10 krpm, and they are made of steel, which is inexpensive but gives them a significant weight. Consequently, this kind of FESS is generally heavy and bulky, making it suitable for large scale stationary applications, such as underground FESS banks devoted to primary-secondary frequency regulation [20]. Differently, high-speed FESSs have a much wider speed range (up to hundreds krpm), thus they are able to store as much energy as low-speed FESSs, but with a significant weight reduction. As a result, high-speed FESSs are more suited for small-scale stationary and vehicular applications, such as small power plants and buses [20]. However, the very high rotating speed makes steel no more suitable due to the high mechanical stresses acting on the flywheel; consequently, titanium or carbon-fiber materials have to be employed, which increase cost, design and manufacturing complexity compared to steel-based solutions [20,24,27,28].
Another FESS classification consists of non-integrated and integrated topologies [19,29]; the former entails that the flywheel and the electrical machine devoted to its acceleration/deceleration are two independent devices, connected to each other through appropriate coupling devices. This configuration allows the flywheel and the electrical machine to be designed almost independently, but requires additional components for their coupling, as well as larger dimensions compared to integrated configurations [19]. The latter consists of integrating the flywheel into the rotor of the electrical machines, which could be either inner or outer depending on the machine configuration. As a result, a more compact and efficient FESS can be achieved, at the cost of increased design complexity and constraints [19,30,31].
In this scenario, this paper presents the control system design and an extensive energy analysis of an integrated FESS configuration for residential prosumers [32,33]. In particular, the proposed FESS aims at storing 8 kWh of energy, to be exchanged with the main grid at 8 kW in order to be competitive in terms of both energy and power capabilities versus other battery-based solutions. In order to achieve such a high energy target, the proposed configuration relies on an inner-rotor large-airgap surface-mounted permanent magnet synchronous machine (IRLA-SPM), whose inner rotor integrates a tick carbonfiber flywheel; this acts also as a sleeve for retaining PMs to the rotor surface at any speed. The design process and functionality tests of IRLA-SPM have been already detailed in [32,33], whereas this paper focuses on its control system design and energy analysis over realistic operating scenarios. In particular, Section 2 presents a general overview of the proposed FESS, together with the definition of its operating modes according to its rotor speed and user's needs. Subsequently, its energy management system (EMS) is presented in detail (Section 3), as well as FESS control system; the latter consists of both machineand grid-side control subsystems, which are devoted to reference current/power tracking in order to ensure proper FESS operation at any operating condition. The effectiveness of the proposed FESS has been validated through extensive simulation studies (Section 4), which have been carried out through MATLAB-Simulink by means of a real-time simulator in order to analyze FESS energy performance accurately over relatively long time horizons. The corresponding results are then presented and discussed (Sections 5 and 6), followed by some concluding remarks (Section 7).

System Overview
Referring to the schematic overview shown in Figure 1, the proposed FESS is assumed installed into a house, together with a PV power plant. The latter is equipped with its own power conversion system and three-phase (or single-phase) connected to the main electrical cabinet. The house is assumed characterized by some single-phase loads, such as domestic lighting systems and various household appliances (washing machine, dishwasher, vacuum cleaner, etc.), which are grouped together and generically denoted by "loads". Both PV and loads concur to determine the overall domestic power demand, which can be either positive or negative depending on PV generation and load consumption values. In this scenario, the role of the proposed FESS is to increase the self-consumption, namely to store the excess energy coming from PV during daytime hours, releasing it in accordance with load consumption. Consequently, FESS acts as an energy buffer, by time-deferring PV generation to better match the load profile, thus minimizing the energy exchange of the house with the main grid.

Flywheel Energy Storage System (FESS)
The proposed FESS consists of three main components, namely the motor/generator (M/G) integrated with the flywheel, and two two-level three-phase power converters, devoted to M/G-side and grid-side power control purposes, respectively. The two converters are coupled through a DC-link, which decouples M/G and grid powers to each other through a capacitor module.
Regarding the M/G, the IRLA-SPM shown in Figure 2 has been designed ad hoc for this application [32,33]. An inner-rotor configuration has been selected to achieve high rotating speed by limiting peripheral speed appropriately. However, the surface-mounted configuration still requires the use of a carbon-fiber sleeve to restrain the PMs on the rotor surface. In this regard, the most distinctive feature of the proposed configuration consists of integrating the flywheel within the sleeve, by increasing its thickness in accordance with both PM containment and energy requirement. This leads to a very thick sleeve (approximately 36 cm) due to the relatively high amount of energy to store (approximately 8 kWh), and, thus, to a large-airgap machine. However, a very large airgap is not a critical issue as magnetic flux density should be reasonably low due to the high-speed range (up to 18 krpm), also leading to almost sinusoidal magnetic flux density distribution. The latter and the use of ferrite PMs enables core losses reduction, which is fundamental at high speed operation. The use of ferrite PMs also limits costs and availability issues of highenergy density PMs, enabling higher operating temperatures as well.  The proposed FESS is equipped with an integrated energy management and control system. In particular, the EMS defines the most suitable FESS reference power in accordance with PV production and load demand. However, user's preferences are considered as well, for example setting the desired turn on and off times during the day, which are represented by the on/off signal depicted in Figure 1. Consequently, different operating modes are foreseen, as detailed in the following.

FESS Operating Modes
Different FESS operating modes have been considered depending on user's preferences and rotor speed value, as resumed in Table 1. In particular, when the on/off signal equals zero, shut down always occurs, meaning that the FESS has to decelerate down to zero regardless of its actual speed value. At this operating mode, the EMS is in FESS-based configuration, namely it prioritizes the achievement of zero speed by delivering all the stored energy to the grid, thus ignoring the desired reference grid power. Differently, when the on/off signal is equal to 1, two different operating modes can occur depending on the rotor speed value. Particularly, pre-charging occurs when the rotor speed is below the rated value, so FESS has to be accelerated up to the rated speed in order to be able to exchange energy at rated power without any torque overloading. Consequently, also at this operating mode, FESS draws energy from the grid to achieve the target speed regardless of the reference grid power profile synthesized in accordance with PV generation and load demand. This reference power profile is instead prioritized at ready, namely when the rotor speed is greater than or equal to the rated speed; in this operating condition, the EMS imposes the achievement of the reference grid power profile by driving FESS accordingly. In this regard, it is worth noting that FESS power is limited appropriately to preserve its speed operating range (from ωm,nom to ωm,max); this means that no energy is delivered by FESS at ωm,nom, while no energy is drawn at ωm,max.
Regardless of the specific operating mode, the EMS has to always ensure DC-link voltage regulation, by synthesizing reference power profiles accordingly. Once these have been defined, their tracking is demanded to the M/G-side and grid-side converter control systems, whose structure and operating principle are detailed extensively in Section 3.

Energy Management System
The equivalent block scheme of the proposed EMS is shown in Figure 3. It consists of an always running component (VDC loop) and two main parts, namely FESS-based and grid-based EMSs, which are activated alternatively. In particular, the EMS selects both M/G-side and grid-side reference powers in accordance with the actual Operating Mode (OM), transmitting them to the local control systems for their appropriate tracking. All these subsystems are detailed in the following subsections.

DC-Link Voltage Loop
Considering the VDC loop at first, its task is ensuring that the DC-link voltage is held constant at the desired value. Therefore, considering the current balance at the DC-link (Figure 1), the following relationship holds: where C is the capacitance of the DC-link capacitor module, VDC is the DC-link voltage, while ig and im denote the current delivered by the DC-link to the grid and by the M/G to the DC-link, respectively. By multiplying both sides of (1) by VDC, the power balance can be achieved easily as Therefore, since VDC and EDC are proportional to each other, DC-link voltage regulation can be assured by regulating EDC through PDC, leading to the DC-link voltage loop structure shown in Figure 4a. In particular, a Proportional-Integral (PI) regulator is employed, whose gains have been synthesized in accordance with (2) and the desired closedloop dynamic performance. Power limitation and anti-windup filter have been considered as well to be compliant with system constraints. Once PDC * has been determined, its tracking is demanded either to FESS-based or to grid-based EMS depending on the FESS operating modes resumed in Table 1.

FESS-Based EMS
The FESS-based EMS consists mainly of a speed loop, which is detailed in Figure 4b. The speed loop can be designed by referring to the torque balance at M/G shaft: in which Te denotes the torque applied by the M/G, ωm is the mechanical rotor speed, J and D are the inertia and damping coefficients, respectively, while Tf is a friction torque that accounts for additional losses (couplings, bearings, etc.). Based on (3), the design of a PIbased speed loop is straightforward, by choosing the PI gains in accordance with zeropole cancellation and dynamic performance requirements. Furthermore, M/G torque needs to be limited in accordance with rotor speed as: In particular, (4) enables M/G torque and power limitations simultaneously; it also highlights that FESS rated power (Pm,nom = Te,nom·ωm,nom) can be achieved only at or above the rated speed unless torque overloading is foreseen; this is not the case considered in this paper because it would lead to M/G overstresses and higher losses, which is undesirable for the specific application (FESS). Consequently, the FESS should always operate between ωm,nom and ωm,max in order to exploit its rated power capability.

Grid-Based EMS
Grid-based EMS is activated when FESS speed lies within [ωm,nom,ωm,max], meaning that FESS is ready to exchange the required energy with the grid. Consequently, referring to Figure 3, given both PDC * and Pg * , FESS power is determined simply through (2) as However, Pm * given by (5) has to be limited in accordance with not only M/G torque and power limitations, but also in order to ensure that FESS always operates within [ωm,nom,ωm,max]. Consequently, maximum and minimum power values, both denoted by for the sake of simplicity, can be defined as in Figure 5; this reveals that delivered or absorbed power derating occurs when the rotor speed approaches its minimum and maximum allowable value, respectively. As a result, excessive FESS discharge and overcharge are prevented successfully. The power derating regions are identified by ωm,low and ωm,high, whose choice should be done properly; particularly, on the one hand these thresholds should be fairly close to minimum and maximum rotor speed values in order to exploit FESS full power capability over a wide speed range. On the other hand, a smooth transition should be advisable in order to prevent sudden and frequent FESS power variations due to some speed ripple. Apart from setting properly, an additional power term should be considered in defining the overall FESS reference power (δPm * ), as highlighted in Figure 3. Otherwise, when ωm equals ωm,nom and the reference grid power demand is greater than or equal to zero, rotor speed would drop below ωm,nom as no power can be drawn from the grid. Since this should not occur at ready operating mode, δPm * is provided by a speed loop, whose reference speed is set at ωm,nom and whose reference torque can be only greater than zero; this means that this speed loop provides a positive reference torque signal only when the speed is below ωm,nom, while providing zero otherwise. In conclusion, considering both and δPm * , the FESS reference power can be finally achieved, as well as Pg * in accordance with (5).

IRLA-SPM Control System
The overview of the IRLA-SPM control system is shown in Figure 6; its main task consists of tracking the reference power profile Pm * at best, by complying with all M/G constraints simultaneously. In this regard, it is worth noting that Pm * already complies with torque and power limitations, thus just current limitation (Ci) and voltage saturation (Cv) have to be considered; these can be expressed as where vdq and idq denote voltage and current space vectors in the dq synchronous reference frame, while is the maximum M/G current magnitude. Considering now M/G voltage equation, this can be expressed as in which r and L are the phase resistance and synchronous inductance, respectively, p is the number of pole pairs, and Λ is the equivalent magnetic flux linkage due to PMs. Electromagnetic torque and power equations can be instead expressed as in which the minus sign appearing in the torque-power relationship is due to the fact that positive Pm values mean FESS discharging and, thus, negative torque values applied to the M/G shaft. Consequently, since IRLA-SPM torque depends on q current component only, id * can be set in accordance with DC-link voltage capability and M/G voltage demand (flux-weakening). In particular, assuming to be at steady-state operation, substituting (7) into (6) yields The graphical representation of (9) onto the (id,iq) plane is shown in Figure 7, together with the torque locus defined by (8). Since ς moves to the left-side of the plane and ρ significantly decreases with the rotor speed, it becomes apparent that negative id * values are required at high-speed operation because both Ci and Cv must be satisfied. Among the several flux-weakening methods proposed in the literature for determining id * [34], the voltage-follower PI regulator is here considered [35]; particularly, as soon as M/G voltage demand exceeds VDC, this deficit is processed by a PI regulator in order to inject a suitable demagnetizing d current component, leading to flux-weakening operation, as highlighted in Figure 6. This approach is simple and effective, although it suffers from relatively low dynamic performance; this is because increasing PI gains excessively would lead to d current component injections at dynamic operations, in correspondence of which M/G voltage demand is high but just transiently. Consequently, a trade-off between dynamic and steady-state performance has to be achieved.
Once id * has been determined by limiting it in accordance with , both id * and concur to limit iq * , which is preliminary determined in accordance with Pm * . Both id * and iq * are then tracked by means of two PI-based current loops, which can be designed in accordance with (7) but expressed as ( ) , .
In particular, M/G phase currents (iuvw) are converted into the corresponding dq space vector through the Clarke and Park transformations. Current errors are then processed by two PI regulators to synthesize the auxiliary voltage vector vdq * , then vdq * is preliminary computed through the feed-forward compensation defined by (11). Afterwards, preliminary vdq * magnitude is fed back to the voltage follower, then it is limited in accordance with Cv. The final voltage vector vdq * is converted into M/G reference phase voltages and, then, into suitable pulse width modulation signals to drive the M/G converter properly, as still highlighted in Figure 6.

Grid-Side Converter Control System
The block diagram of the grid-side converter control system is shown in Figure 8. This reveals many similarities with Figure 6, especially on the current loops, although some differences occur. In this regard, the same symbols used for M/G voltage and current space vectors, i.e., vdq and idq, are employed also for the corresponding grid-side quantities for the sake of simplicity, although they correspond to different variables. First of all, grid phase voltages (erst) are processed by a phase-locked loop (PLL) to compute both magnitude (E) and displacement (φ) of the fundamental voltage space vector. Subsequently, E is employed for limiting grid complex power Sg in accordance with in which is the maximum allowable grid current, while conj denotes the complex conjugate operator. The grid space vector displacement is instead employed for converting grid phase currents (irst) into the corresponding dq space vector. The two PI regulators can be thus designed in accordance with the following voltage relationship: in which ω is the grid pulsation, while rg and Lg are line resistance and inductance, which also account for the grid filter. Once vdq * has been determined, the same procedure already described for the M/G control system applies, except that rotor position is replaced by grid space vector displacement.

System Setup
The proposed FESS has been modeled in MATLAB-Simulink in order to verify its performance by means of an extensive simulation study, which is preparatory to the prototyping stage. In particular, simulations have been carried out by means of a real-time simulator, i.e., OP-4500 by OPAL-RT [36], which enables fast simulations over relatively long time horizons (several hours). The simulation setup has been defined in accordance with Figure 1, particularly a domestic user has been considered, whose daily load profile is shown in Figure 9a. In addition, a PV power plant is also foreseen (5 kWp), and two different production profiles have been considered in order to emulate sunny and cloudy days alternatively [37], as shown in Figure 9b. The main specification of the proposed FESS system is instead resumed in Table 2.   Table 3. In particular, functionality tests have been performed at first, namely two full charging-discharging cycles have been carried out in order to evaluate FESS energy efficiency over different speed operating regions and DC-link voltage ratings (cases A1 and A2). A self-discharge test has been also carried out in order to estimate the self-discharge rate (case B1). Subsequently, the proposed FESS has been tested into a real scenario, namely during a sunny and a cloudy day, in order to evaluate its overall performance and efficiency over a wider time horizon (cases C1 and C2). All the results presented in the paper are sampled at 1 Hz, while the sampling time of EMS and FESS control system has been set at 100 µs.

Results
The results achieved by real-time simulations are reported in Figures 10-17, as well as from Tables 4-6, and explained and analyzed in the following.

Cases A1 and A2: Round Trip Tests
The results achieved during round-trip tests are shown in Figures 10 and 11, while the energy efficiency (η) achieved by FESS over different speed operating regions is summarized in Table 4.
Considering Figure 10 at first, it can be seen that no-appreciable differences occur between cases A1 and A2, namely different DC-link voltage values do not affect FESS power, speed, and torque, as well as grid energy exchange. This occurs despite flux-weakening operation occurring in case A1 when the speed exceeds approximately 1.8 pu, which requires some im,d injection to cope with the relatively low DC-link voltage compared to case A2 (Figure 11). Such a seemingly anomalous result is due to the fact that flux-weakening increases Joule losses but reduces core losses by almost the same amount; as a result, case A1 is characterized by almost the same energy performance achieved in case A2, even slightly better, as pointed out in Table 4.
Focusing on Table 4, this also highlights that FESS energy efficiencies achieved at constant-torque operation over the charging and discharging stages in cases A1 and A2 are the same; this is expected because no flux-weakening operation occurs due to the relatively low speed range. On the other hand, FESS charging efficiency at constant-power in case A2 is slightly lower than the other efficiencies achieved at similar constant-power operating conditions; such a slight difference is because FESS charging is slightly slower than discharging due to frictional torques acting on the rotor shaft, leading to an energy efficiency mismatch between these two processes. This phenomenon is not detectable in case A1 because of im,d injection, which affects FESS charging more than discharging, as shown in Figure 11.

Case B1: Self-Discharge Test
The results achieved during the self-discharge test are shown in Figure 12 and resumed in Table 5. In particular, the proposed FESS is preliminary fully charged at its maximum speed, then the self-discharge test is started by disconnecting the IRLA-SPM from its DC/AC converter. As a result, the speed slowly decreases due to all the frictional torques acting on the rotor shaft. Both Figure 12 and Table 5 reveal that ωm drops at its rated/minimum value after approximately 47 h, meaning that the FESS self-discharge daily rate is approximately 0.51 pu (=24 h/47 h). However, since FESS is able to provide energy even below the rated speed (but not at rated power), FESS self-discharge rate could be also estimated as 0.30 pu (= 24 h/81 h). In any case, such high self-discharge rates suggest that the proposed FESS should not be used for storing and then delivering energy over time horizons longer than few hours unless strictly needed. Otherwise, most of the stored energy would be wasted due to frictional losses.

Cases C1 and C2: Sunny and Cloudy Days
The results achieved during a sunny and a cloudy day (cases C1 and C2, respectively) are shown in Figure 13-17, while the corresponding FESS energy performance and efficiency are resumed in Table 6. In particular, Figures 13-15 refer only to the case of 720 V because all the evolutions are almost superimposed with those achieved at 360 V. On the other hand, Figures 16 and 17, and Table 6 highlight different losses and energy performance achieved at both 360 V and 720 V for comparison purposes.    Considering case C1 at first (Figures 13a-15a), it can be seen that FESS is started at 8:00, when PV production already overcomes the load demand, as detectable in Figure  13a; the FESS is then charged at reduced torque and power rating in order to achieve its rated speed not before 1 h (Figure 15a); in this regard, the pre-charging stage, which could be accomplished in approximately 15 min (Figure 10), has been slowed down properly in order to avoid unsuitable peak power drawn from the grid. As soon as the rated speed is achieved, FESS enters into the ready operating mode, by drawing the excess PV production in order to guarantee no energy exchange with the main grid, as shown in Figure 14a. As the speed approaches its maximum value, FESS absorbed power is reduced in accordance with Figure 5 until the FESS is almost fully charged at approximately 12:00 (Figure 15a). Afterwards, FESS becomes idle, namely it just absorbs the power needed to keep its speed constant. This operating condition persists approximately until 16:00, when PV production drops below the load demand (Figure 13a), enabling FESS to deliver the energy previously stored from PV. As a result, grid power exchange in nullified again (Figure 14a), while FESS speed decreases down to its rated value, which is reached at approximately 20:40 (Figure 15a). During this period of time, FESS also partially compensates for fast load power fluctuations occurring at 17:30-18:00, as shown in both Figures 13a and 14a. As PV production does not occur further, and FESS has already reached its minimum energy content, its operating mode is switched to shut down; similar to the pre-charging stage, this operating mode has been slowed down to 1 h in order to prevent unsuitable power peak. Consequently, FESS speed decreases, while FESS delivers reduced and decreasing power until it is fully discharged.
Considerations similar to those provided for case C1 still apply to case C2 ( Figure  13b-Figure 15b), although some differences occur. In particular, the cloudy day determines a high-fluctuating PV production profile (Figure 13b), with less energy content than case C1. Consequently, FESS is able to compensate for PV production over the overall day ( Figure 14b) because FESS never reaches its maximum and minimum energy content (Figure 15b). As a result, almost no power exchange occurs with the main grid when FESS is at the ready operating mode, apart from some fast power fluctuations that could not be completely compensated.
Considering now the losses evolutions achieved in both cases C1 and C2 ( Figure 16 and Figure 17, respectively), it can be seen that iron losses are reduced significantly in case C1 by flux-weakening operation (Figure 16a, @360 V), with just a marginal increase of Joule losses compared to the case at 720 V. This results in lower overall losses and it is particularly relevant because maximum speed is kept for several hours (from 12:00 to 16:00). Much less benefit is achieved by flux-weaking in case C2 ( Figure 17) due to relatively low speed range swept by FESS during the cloudy day.
Power and energy performance achieved by FESS over the overall two days are resumed in Table 6. In particular, peak, average, and ripple powers have been computed in accordance with the following relationships, respectively: The power data reported in Table 6 reveals that FESS is able to reduce peak grid power, especially over the cloudy day (case C2). This comes at the cost of increased energy drawn from the grid due to FESS losses, as highlighted by the lower average powers achieved compared to the case without FESS. In addition, a significant power ripple reduction is achieved by FESS, meaning that FESS reduces grid power fluctuations during both cases C1 and C2. Considering now energy performance, Table 6 reveals daily energy efficiency lower than those reported in Table 4, as expected. This is because of some idle periods, during which FESS draws energy for keeping its speed constant at maximum or minimum values, thus operating at zero efficiency. Such undesirable operating conditions more often occur during the sunny day (case C1), thus justifying lower daily efficiencies than case C2. Furthermore, when operating at maximum speed for approximately 4 h (case C1), higher losses occur at 720 V compared to 360 V, as already highlighted in Figure 16, thus justifying the slightly lower efficiency achieved with no flux-weakening operation. This difference does not almost occur during the cloudy day (case C2) because FESS operating speed range is generally below 1.8 pu (Figure 15b), thus flux-weakening is rarely required.

Discussion
Real-time simulations carried out on the proposed FESS at different operating conditions give a generally positive feedback, although they highlight some potential criticalities that should be considered carefully.
Focusing on round trip tests at first (cases A1 and A2), round trip efficiency is high, especially that achieved at constant-power operation (approximately 92.5%), consistent with that of most of the electrochemical batteries on the market. However, it is worth pointing out that it does not account for converter losses (both M/G-side and grid-side), as well as for all the auxiliaries (control boards, cooling system, etc.). Consequently, a more accurate efficiency assessment would lead to values around 90%, meaning that FESS design should be improved further to make it competitive on the market versus other energy storage solutions. In this regard, a first and viable solution surely consists of employing magnetic bearings, by decreasing mechanical losses significantly, as electromagnetic losses are already quite low due to the large airgap and suitable PM materials. In addition, more advanced control strategies could be employed, such as Maximum Efficiency, thus benefiting from some flux-weakening even at low speed operation for decreasing core losses suitably. On the other hand, the very similar results achieved at both 360 V and 720 V reveal the high flexibility of the proposed FESS, which could be connected to either European 230/400 VRMS or US 120/208 VRMS grids indifferently (both single-phase and three-phase connections).
Considering the self-discharge test (case B1), no particular criticalities arise as long as the proposed FESS is not intended to store energy for long periods of time (several hours/days). Consequently, although FESS self-discharge rate is surely much higher than those of electrochemical batteries, it does not jeopardize its daily employment on condition that long idle periods are avoided.
Considering the real operating scenarios (cases C1 and C2), the corresponding results reveal good FESS operation, particularly FESS is able to guarantee no energy exchange with the main grid for relatively long periods of time, especially during cloudy days. However, daily efficiencies are relatively low if compared to those achieved in cases A1 and A2 (approximately 71% instead of 92.5%): this is due to the fact that FESS power is generally low in cases C1 and C2, particularly its peak value is approximately half of the rated value (4 kW), as highlighted in Figure 13. As FESS losses mostly depends on its rotating speed, such a weak FESS power exploitation determines reduced efficiencies compared to round-trip tests (cases A1 and A2). Better results could be thus achieved by considering increased PV size and/or load demand, such those occurring for a large house or a building rather than for small-medium size houses.
In conclusion, FESS operation can be improved further by, for example, a better time coordination between FESS pre-charging/shut down and user's residual power profile, namely the difference between PV production and load demand. In particular, FESS operating modes now occur at fixed time slots (8:00 and 21:00, respectively), whereas they could be defined and updated adaptively based on historical data. Similarly, these starting/ending stages could last more or less than 1 h in accordance with user's preference or energy optimization criteria. Last but not least, more advanced energy management systems can be employed, by preventing or optimally determining the achievement of its maximum/minimum energy content [38][39][40]. Moreover, coordination with other energy storage systems and/or deferrable loads could be carried out to optimize system performance further.

Conclusions
An energy management and control system for an integrated Flywheel Energy Storage System (FESS) has been presented in this paper. This has been developed in accordance with the specific application for which the proposed FESS is designed, namely for residential users that own a photovoltaic power plant. In this regard, four different operating modes are defined, which prioritizes FESS pre-charging and/or shut down appropriately, by increasing user's self-consumption to the maximum extent. The power and energy performance achieved by the proposed FESS have been analyzed in detail through an extensive real-time simulation study, which reveals very good performance in terms of round-trip and, to a less extent, of daily efficiency. Additionally, increased user's selfconsumption capability and reduced grid power fluctuations have been achieved, especially during cloudy days, revealing the effectiveness of the proposed energy storage solution; this will be verified further through experimental prototyping and testing of a reduced-scale FESS, which is actually ongoing.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.