Dynamic Modelling of a Solar Energy System with Vehicle to Home and Vehicle to Grid Option for Newfoundland Conditions

DOI: http://dx.doi.org/10.24018/ejece.2021.5.3.329 Vol 5 | Issue 3 | June 2021 45 Abstract — The dynamic modelling of a solar energy system with vehicle to home (V2H) and vehicle to grid (V2G) options for Newfoundland conditions is discussed in this paper. A site (13 Polina Road) was chosen in St. John's, Newfoundland, Canada. An optimized system was built for the chosen site using BEopt, Homer, and MATLAB software’s to meet the house's energy demand. Furthermore, smart current sensors installed in the house are used to incorporate the V2H and V2G concepts. The Nissan Leaf's battery is used to supply household loads in V2H operation mode when the power supplied by the PV panel and the storage energy in the inhouse battery is less than the load's energy demand. In V2G mode, the vehicle is only linked to grid. Along with the simulation results, detailed system dynamic modelling is also presented. There are nine different system control modes that are proposed and simulated.


I. INTRODUCTION
Electric vehicles (EVs) are the next wave in the global transportation industry. EV's have various advantages, more powerful, emit no pollution and act as mobile power reservoirs. EV's need to be charged, renewable sources of energy, such as solar energy systems, help satisfy the energy demand and also to reduce the carbon footprint [1] Since renewables are inherently variable, backup battery is required. Since EVs act as reservoirs, the concept of Vehicle to Home (V2H) and Vehicle to Grid (V2G) can be implemented [2], [3]. The proposed system implements V2H and V2G concept. The in-house battery acts as backup battery, to supply uninterrupted power the home load's when the power produced by PV is not sufficient to meet the load's energy demand. The Nissan Leaf (40kW variant) is being considered as EV, for use in the V2H concept. Furthermore, the implemented system has level 1 and level 2 chargers for charging the Nissan Leaf's battery during charging mode, as well as a converter for charging the inhouse battery and powering the load at the same time. Until the produced power is less than the load's energy requirement, the designed system uses PV as the primary source of power. However, if the power produced by PV was less compared to load's energy demand, the inhouse battery is used to power the loads in this situation. When the system reaches 30% SOC, it switches to V2H, which means the Nissan Leaf's battery will be discharged to satisfy the load's energy demand [4]. In V2G Submitted on May 23, 2021. Published on June 13, 2021. Raghul Suraj Sundararajan, Memorial University of Newfoundland, Canada. (e-mail: rssundararaj mun.ca) mode, the car disconnects from the house and feeds power to the grid [5], [6] In this paper, we present a solution that addresses this problem by combining the Vehicle to Home (V2H) and Vehicle to Grid (V2G) principles, as well as a hybrid PV system [7]. For system sizing and dynamic modelling, BEopt, HOMER, and MATLAB were used.

A. Selected Site and Solar Insolation
The research location was selected as 13 Polina Road in St. John's, Newfoundland, Canada. It has a total area of 185.89 m 2 . In St. John's, Newfoundland, Canada, Fig. 1 depicts a monthly solar radiation and clearness index profile for the chosen region. The clearness index varies from 0.20 to 0.30. The average solar insolation is 3.15 kWh/m 2 /day, with a range of 1.28 kW/m 2 /day to 5.14 kWh/m 2 /day.

B. Sites Power Requirement from BEopt
The annual power demand for the chosen site was calculated using BE opt tools. The annual power consumption of the house is approximately 21111 kWh. This covers all loads in the building, such as heaters, boilers, lighting, ventilation, and other factors including plugin loads.

C. Sites Load and Photovoltaic Panel Area Calculation
The daily load requirement for the site is 11.90 kW. The hourly electricity demand rises at 6 a.m. and falls by 9 p.m., with an all-time high between 6 and 7 PM. Fig. 2

III. SYSTEM SIMULATION
The software Hybrid Optimization of Multiple Energy Resources (HOMER) was used to size the system. A schematic of the proposed system is shown in Fig. 4. The solar panel used was a Canadian Solar CS6U-340M, the battery was a Trojan SAGM 12 105, the inverter was 20 kW, the home load profile was 57.8 kWh/d with a peak of 11.90 kW and a backup, a 10 kW genset is installed, which has no effect on the system's dynamics.

C. Nissan Leaf -40 kW variant
Nissan Leaf with a 40 kWh lithium-ion battery pack and a 6.6 kW onboard charger is considered in this concept. A builtin bidirectional converter for charging and discharging is another benefit of the Nissan Leaf (reeling power to home). Charging and discharging are the two modes of operation for the Nissan Leaf. Nissan Leaf is reeling out power or discharging its battery, when the PV panels and battery are unlikely to fulfill the energy demand of the home load, this mode is used [8], [9]. When the Nissan Leaf is in charging mode, the following is assumed. The electric vehicle is charged with the excess energy generated or stored after the home loads are met [10].

D. Inverter
The peak load value is about 19.90 kW and deferrable loads peak value is 6.60kW, an inverter with a 20 kW output capacity is considered for the design. In this case, the inverter has two outputs: 120 V and 240 V.

IV. DYNAMIC MODELLING
Simulink was used to simulate the proposed architecture. PV array, MPPT controller, in-house battery, boost converters, inverter, level 1 and level 2 chargers, Nissan Leaf battery and V2G inverter are all included in the simulation. The overall block diagram of the proposed system is shown in Fig. 5. PV power is used to charge the in-house battery via a charger, and an inverter with two outputs at 120 V and 240 V is used to convert the stored power in the battery to AC to power the house load. Furthermore, a Nissan leaf charger with level 1 and level 2 charging capabilities [8] is designed, as well as a converter to step down 360 V to 48 V, which is used to charge the in-house battery and simultaneously powering the house loads [9] and a 10 kW genset is incorporated which is used only as a backup and has no impact on dynamics of the system. Overview of simulated system is illustrated in Fig. 6. The system is simulated for charging and discharging the in-house battery, powering loads with the in-house battery, a dual outlet inverter that outputs 120 V and 240 V, a Nissan leaf charger with level 1 and level 2 charging.
Discharge Nissan Leaf to charge inhouse battery, discharge inhouse battery at night to charge Nissan Leaf, discharge Nissan Leaf to implement V2G mode and a dump load to remove excess power. Automatic state of charge overrides is included in the system, with 30 percent SOC charge ON (inhouse battery) and 40 percent SOC charge ON (Nissan Leaf battery) for the inhouse battery and Nissan Leaf, respectively. Fig. 6 shows the full Simulink simulation block diagram.

A. MPPT Algorithm
Maximum power point tracking (MPPT) is a concept that entails adjusting PV impedance in response to changing irradiance in order to get the most power out of a PV panel. In this simulation, the MPPT controller employs the Perturbation and Observation (P&O) algorithm. In the P&O algorithm, the voltage is continuously perturbed, and the inverter duty cycle is updated based on the output observation. This algorithm is the best at monitoring the maximum point even though there is a large drop or spike in irradiance.
Furthermore, the simulation was carried out incorporating eight modes representing different modes [10] of operation. Fig. 7 illustrates the implemented switching control logic.

B. Model 1 -Inhouse Battery Charge Mode
The PV output is used to charge the in-house battery and power the loads in this mode. The energy consumption of the loads is minimal in this situation. The extra energy is put to good use by charging the battery. The control logic for charging inhouse battery is depicted in Fig. 9. Switches S1, S2, S3, S8, S9 are switched ON to implement mode 1 as seen in Fig. 8 and Table I. The current and voltage graphs for the low load are seen in Fig. 9 and 10. The voltage and current of the load are 120V and 12A, respectively.

C. Mode 2 -Inhouse Battery Discharge Mode
PV output is low in this mode relative to the load's energy requirement. The load is powered by the in-house battery in this situation. The control logic for in-house battery in discharge mode is seen in Fig. 11. A two-output inverter is also used, with output voltages of 120 V and 240 V. Switches S3, S8, S10 are turned ON to implement mode 2 as seen in Fig. 10 and Table I. The current and voltage graphs for high loads are seen in Fig. 12 and 13. In this case, the load is 240 V and 27 A.

D. Mode 3 -Nissan Leaf Charge Mode
When the PV output exceeds the load's energy demand and the in-house batteries' SOC exceeds 60%, the device will charge the Nissan Leaf battery [11]. Level 1 (120 V, 14 A) and level 2 (240 V, 20 A) charging are both used in the charger. The control logic for Nissan Leaf at level 1 and level 2 charging modes are depicted in Fig. 14 and 15, respectively. The power for the level 1 and level 2 chargers is supplied by an inverter. Furthermore, boost converters have been integrated into the chargers to increase the voltage to 360 V, which is the charging voltage of the Nissan Leaf battery. Switches S1, S2, S3, S4, S5, S8, S9 are turned ON to implement mode 3 (level 1 charging) as seen in Fig. 14 and Table I. For mode 3 (level 2 charging) switches S1, S2, S3, S4, S6, S8, S9 are turned ON and switches S5, S10, S11 are turned OFF as seen in Fig. 15 and Table I. The charging current graphs for level 1 and level 2 charging are seen in Fig.  17 and 18. Fig. 19 depicts the state of charge (SOC) of a Nissan Leaf battery. The developed system includes both level 1 and level 2 charging, with the output from level 2 charging is visible between 5 and 10 seconds and the output from level 1 charging is visible between 10 and 15 seconds [12], [13].

E. Mode 4 -Nissan Leaf Discharge Mode
When the PV output is less than the load energy demand and the inhouse batterie SOC is less than 30%, Nissan Leaf reels out the stored energy to the house to satisfy the load energy demand [14], [15]. The control logic for Nissan Leaf in discharge mode is depicted in Fig. 18. To charge the battery and power the load at the same time, a buck converter is used to reduce the high voltage (360 V) from the Nissan Leaf's battery to 48 V [16]. Switches S7, S8, S10 are turned ON to implement mode 4 as seen in Fig. 18 and Table I. The SOC graph for the Nissan Leaf as shown in Fig. 19. Because of Nissan Leaf's discharge mode execution, the inhouse battery was on a discharge loop between the time intervals of 5 seconds and 15 seconds in Fig. 19, and then it began to charge.

F. Mode 5 -Inhouse Battery Protection Mode
This mode is included to assist in the saving of the in-house battery by tracking the battery's SOC. When the SOC of inhouse batteries drop below 30%, the 30% SOC breaker and the 30% SOC charge on breaker will all go HIGH to charge the battery. Switches S2, S3 are switched ON to implement mode 5 as seen in Table I.

G. Mode 6 -System Isolation Mode
The total cutoff breaker is switched on in this mode because the PV output is less than the loads energy demand, the inhouse batteries SOC is less than 30%, and the Nissan leaf SOC is less than 40%. This is designed to separate the system from the load and prevent it from failing. Switch S2 is switched ON to implement mode 6 as seen in Table I.

H. Mode 7 -Excess Power Management Mode
When the power produced by PV exceeds the energy demand of the load, the in-house battery and Nissan Leaf's battery are charged, and a dump load is used to dissipate the excess power. The control logic for excess power mode is illustrated in Fig. 20. Switches S1 and S11 are switched ON to implement mode 7 as seen in Fig. 20 and Table I

I. Mode 8 -Nighttime Charging Mode
The power stored in the inhouse battery is used to charge the Nissan Leaf's battery at night while the loads energy demand is much lower and the inhouse battery's SOC is greater than 60% [17]. The control logic for nighttime level 1 and level 2 charging mode is depicted in Fig. 21 and Fig. 22. Switches S3, S4, S5, S8, S9 are switched ON to implement mode 8 at level 1 charging as seen in Fig. 21 and Table 1. In mode 8 level 2 charging switches S3, S4, S6, S8, S9 are switched ON as seen in Fig. 22 and Table I.

J. Mode 9 -V2G Mode
In this mode the vehicle isolates itself from home and reels power to the grid [18], [19]. Fig. 23 illustrates the control logic for vehicle to grid (V2G) mode and Fig. 24 illustrates the vehicle to grid mode design in MATLAB. Switch S12 is switched ON to implement mode 9 as seen in Fig. 23 and Table I. The implemented design comprises of PLL block, Current controller (PI) and PWM generator [20]. Fig. 25 illustrates the implemented PI and PLL controller design. PLL is used to generate a reference signal and the signal is in phase with the actual voltage. The reference signal is used for implementation of current controller in a grid connected inverter. Further the Vgrid voltage is fed to a lowpass filter as shown in equation 1 and Further simplification results in equation 7. Adding a second low pass filter as seen in equation 8, the magnitude becomes 1/2 and the angle would be -90 as seen in equation 9. Finally, multiply the output from second low pass filter with 2 to get an output signal (alpha) that is same as input with 90-degree phase shift as seen in Fig. 25.
Further to implement PLL, Vgrid and alpha signals are converter into DQ signals. A control system is set for Q output, the error between Q and Q ref is set as zero and is fed to a PI controller. The output from PI controller gives the angle information which is integrated to get ωt. Output from the Integrator is fed to alpha beta to DQ transformation block. In this case the output from PI controller is aligned with input signal. Hence this value can be used to generate active and reactive current reference signal as seen in Fig. 25 [21], [22].
The generated reference signal is added with grid voltage which generates the reference signal for generation of PWM. A unipolar generation scheme is implemented in the designed system. The reference voltage is compared with the triangular carrier wave and positive and negative references are compared. Output from each comparator is inverted and connected to the gate terminal of each IGBT as seen in Fig.  25. Fig. 26, 27, 28 illustrates the grid's voltage graph, grid's current graph and inverter current graph, respectively.

V. CONCLUSION
For Newfoundland conditions, dynamic modelling of a solar energy system with vehicle to home and vehicle to grid options was successfully designed and simulated. The solar insolation for Newfoundland is 3.15 kWh/m 2 /day, as seen in Fig. 1. The PV panels used are 340W modules that generate 16.3984 kW and are configured in 24 strings, each with two panels. Nissan Leaf is configured as a deferrable load of 9.90 kWh/d and 6.60 kW peak, a 12.5 kW commercially available inverter, 80 Trojan SAGM 12 105 batteries, each rated at 12 V and 100 Ah, a backup genset of 10 kW, and a vehicle to grid (V2G) inverter as seen in Fig. 7. In the simulation that has been implemented, there are nine main operating modes: i) inhouse battery charging mode -PV power is used to charge the inhouse battery while simultaneously powering the loads; ii) inhouse battery discharge mode -The stored power in the inhouse house battery is used to meet the loads energy demand; iii) Nissan Leaf charging mode -The available power is used to charge the Nissan Leaf after satisfying the load's energy demand and charging the in-house battery; iv) Nissan Leaf discharge mode: the loads have a high energy demand, but the PV and in-house battery SOC is low [23]. Nissan Leaf draws on its accumulated energy to meet the load's energy demand [24]; v) in-house battery protection modeavoids degenerative discharge of the in-house battery; vi) system isolation mode prevents system failure; vii) excess power management modemanages excess power generated; viii) nighttime charging modecharges Nissan Leaf overnight in preparation for use the next day; ix) V2G modepower is reeled to the grid. The system is scalable: it can be extended to include parking lots [25], several houses can be joined to form a microgrid [26], and it can control or assist the grid (V2G) [27]. The V2X model, in which vehicles are used to schedule loads [28], power multiple homes, businesses, or an entire city, and transfer power from one vehicle to another [29], will be studied further. [30]- [33].