V2G & G2V Operations in 3-Phase Grid with Bidirectional DC-DC Converter
V2G & G2V Operations in 3-Phase Grid with Bidirectional DC-DC Converter
𝐈𝐧𝐭𝐫𝐨𝐝𝐮𝐜𝐭𝐢𝐨𝐧
Vehicle-to-Grid (V2G) and Grid-to-Vehicle (G2V) technologies enable a bidirectional exchange of electrical power between an electric vehicle battery and the utility grid.

In this MATLAB/Simulink model, an EV battery is connected to a 3-phase, 450 V, 50 Hz grid through two major power-electronic stages:
𝐁𝐢𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐃𝐂-𝐃𝐂 𝐜𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
𝐓𝐡𝐫𝐞𝐞-𝐩𝐡𝐚𝐬𝐞 𝐛𝐢𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐜𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
LCL grid filter
PLL-based grid synchronization
DC-link voltage controller
dq-axis current controller
Feedforward decoupling control
Sinusoidal PWM generation
The simulation demonstrates automatic transition between V2G and G2V operation by changing the EV battery current reference.
𝐖𝐡𝐚𝐭 𝐚𝐫𝐞 𝐕𝟐𝐆 𝐚𝐧𝐝 𝐆𝟐𝐕?
𝐕𝟐𝐆 – Vehicle-to-Grid
In V2G operation:
The EV battery supplies electrical energy.
Battery power flows toward the DC link.
The three-phase converter transfers this energy to the utility grid.
The EV therefore behaves as a distributed energy-storage source.
Battery SOC gradually decreases during sustained discharge.
𝐆𝟐𝐕 – Grid-to-Vehicle
In G2V operation:
Power is taken from the utility grid.
The three-phase converter transfers AC power to the DC link.
The bidirectional DC-DC converter controls battery charging.
Battery charging current flows in the opposite direction.
Battery SOC gradually increases during sustained charging.
Operating Mode | Power Flow | Battery State | Current Reference |
V2G | EV Battery → Grid | Discharging | +30 A |
G2V | Grid → EV Battery | Charging | −30 A |
𝐒𝐲𝐬𝐭𝐞𝐦 𝐎𝐯𝐞𝐫𝐯𝐢𝐞𝐰
The complete power conversion path can be represented as:
EV Battery ↔ Bidirectional DC-DC Converter ↔ DC Link ↔ 3-Phase Converter ↔ LCL Filter ↔ 3-Phase Grid
The main subsystems are:
EV battery
Bidirectional DC-DC converter
DC-link capacitor
Universal Bridge
Three-phase grid interface
LCL filter
PLL synchronization
abc-to-dq transformation
DC-link voltage control
dq current control
Feedforward decoupling controller
dq-to-abc transformation
PWM pulse generator
𝐌𝐚𝐢𝐧 𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐏𝐚𝐫𝐚𝐦𝐞𝐭𝐞𝐫𝐬
The important operating conditions demonstrated in the model are summarized below.
Parameter | Value / Setting |
Grid system | 3-phase AC |
Grid voltage | 450 V |
Grid frequency | 50 Hz |
DC-link voltage reference | 1000 V |
V2G battery current reference | +30 A |
G2V battery current reference | −30 A |
V2G operating interval | 0–1 s |
G2V operating interval | 1–2 s |
Reactive current reference | 0 A |
Main AC converter | IGBT/Diode Universal Bridge |
Grid synchronization | PLL |
Grid-side control | dq-axis control |
Modulation | Sinusoidal PWM |
𝐁𝐢𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐃𝐂-𝐃𝐂 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
The EV battery cannot simply be connected directly to the DC link when controlled charging and discharging are required.
A bidirectional DC-DC converter is therefore placed between the battery and the DC bus.
Its main functions are:
Control EV battery charging current.
Control EV battery discharging current.
Allow power transfer in both directions.
Interface the battery voltage with the DC-link voltage.
Maintain smooth transitions between V2G and G2V.
Protect the battery from uncontrolled current variations.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The measured battery current is continuously compared with its reference value.
The current error is processed by a PI current controller.
The PI controller output determines the required duty cycle for the bidirectional converter.
The switching pulses are then generated for the upper and lower semiconductor switches.
𝐕𝟐𝐆 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧
During the first simulation interval:
Time = 0 to 1 second
The battery current command is:
+30 A
This produces V2G operation.
The sequence is:
EV Battery → Bidirectional Converter → DC Link → Three-Phase Converter → Filter → Grid
The important observations are:
Battery current is regulated around +30 A.
Battery operates in discharge mode.
Battery SOC decreases gradually.
Power is delivered from the EV toward the grid.
Grid voltage and current exhibit the phase relationship associated with exported active power under the adopted current direction convention.
This demonstrates the EV battery functioning as a controllable energy-storage source for the grid.
𝐆𝟐𝐕 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐨𝐧
At:
Time = 1 second
the reference current changes from:
+30 A → −30 A
The system therefore changes from V2G to G2V operation.
During:
Time = 1 to 2 seconds
the sequence becomes:
Grid → LCL Filter → Three-Phase Converter → DC Link → Bidirectional DC-DC Converter → EV Battery
The important observations are:
Battery current becomes approximately −30 A.
Battery enters charging mode.
Power-flow direction reverses.
Grid supplies active power to the EV.
Battery SOC begins to recover.
The grid voltage/current phase relationship changes according to the reversed power-flow direction.
𝐖𝐨𝐫𝐤𝐢𝐧𝐠 𝐏𝐫𝐨𝐜𝐞𝐬𝐬
The overall operating sequence can be understood in a few stages.
1. 𝐌𝐞𝐚𝐬𝐮𝐫𝐞 𝐭𝐡𝐞 𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐮𝐫𝐫𝐞𝐧𝐭
The actual EV battery current is continuously measured.
2. 𝐂𝐨𝐦𝐩𝐚𝐫𝐞 𝐈𝐭 𝐰𝐢𝐭𝐡 𝐭𝐡𝐞 𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞
+30 A → V2G
−30 A → G2V
3. 𝐏𝐫𝐨𝐜𝐞𝐬𝐬 𝐭𝐡𝐞 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐄𝐫𝐫𝐨𝐫
A PI current controller generates the required converter control command.
4. 𝐆𝐞𝐧𝐞𝐫𝐚𝐭𝐞 𝐒𝐰𝐢𝐭𝐜𝐡𝐢𝐧𝐠 𝐏𝐮𝐥𝐬𝐞𝐬
The duty-cycle command is converted into switching signals for the bidirectional DC-DC converter.
5. 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐏𝐨𝐰𝐞𝐫 𝐃𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧
Based on the current reference, the converter controls whether the battery:
Delivers power to the DC bus, or
Receives power from the DC bus.
𝐓𝐡𝐫𝐞𝐞-𝐏𝐡𝐚𝐬𝐞 𝐆𝐫𝐢𝐝-𝐒𝐢𝐝𝐞 𝐂𝐨𝐧𝐯𝐞𝐫𝐭𝐞𝐫
A Universal Bridge constructed using IGBTs with antiparallel diodes is used as the grid-side converter.
Unlike a conventional unidirectional inverter, this converter must support both:
DC-to-AC conversion during V2G
AC-to-DC conversion during G2V
This makes four-quadrant/bidirectional power-flow control possible at the grid interface.
𝐋𝐂𝐋 𝐅𝐢𝐥𝐭𝐞𝐫
An LCL filter is located between the grid-side converter and the utility grid.
Its main purpose is to:
Reduce converter switching harmonics.
Improve grid current quality.
Smooth the converter output current.
Reduce high-frequency components entering the grid.
Improve compliance with grid-connected converter requirements.
The filter therefore plays an important role in achieving good grid-current waveform quality.
𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲
The grid-side converter uses a cascaded voltage and current control structure.
The controller consists mainly of:
Outer DC-link voltage loop
Inner dq current loop
PLL synchronization
Feedforward decoupling
PWM generation
𝐏𝐋𝐋-𝐁𝐚𝐬𝐞𝐝 𝐆𝐫𝐢𝐝 𝐒𝐲𝐧𝐜𝐡𝐫𝐨𝐧𝐢𝐳𝐚𝐭𝐢𝐨𝐧
The Point of Common Coupling voltage is measured from the three-phase grid.
This voltage is applied to a Phase-Locked Loop (PLL).
The PLL determines the instantaneous grid phase angle required for synchronous reference-frame control.
The phase angle is then used by:
abc-to-dq transformation
dq-to-abc transformation
Current-controller synchronization
Grid-converter PWM generation
Accurate PLL operation keeps the converter synchronized with the 50 Hz grid.
𝐚𝐛𝐜-𝐭𝐨-𝐝𝐪 𝐓𝐫𝐚𝐧𝐬𝐟𝐨𝐫𝐦𝐚𝐭𝐢𝐨𝐧
Three-phase grid quantities are transformed from the abc reference frame into the rotating dq reference frame.
The measured grid voltage produces:
Vd – direct-axis voltage
Vq – quadrature-axis voltage
The measured converter current produces:
Id – direct-axis current
Iq – quadrature-axis current
This transformation simplifies AC converter control because sinusoidal three-phase signals appear as approximately constant quantities under steady-state synchronized operation.
𝐎𝐮𝐭𝐞𝐫 𝐃𝐂-𝐋𝐢𝐧𝐤 𝐕𝐨𝐥𝐭𝐚𝐠𝐞 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The reference DC-link voltage is set to:
1000 V
The measured DC-link voltage is compared with this reference.
The resulting voltage error is processed using a PI voltage controller.
The voltage controller generates the required d-axis current reference.
Therefore, the outer controller is mainly responsible for:
Maintaining the DC-link voltage.
Balancing DC-side and AC-side power.
Generating the active-current demand.
Supporting stable V2G/G2V transitions.
𝐈𝐧𝐧𝐞𝐫 𝐝𝐪 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The inner current controller tracks:
Id reference
Iq reference
In this model, the reactive-current reference is maintained at approximately:
Iq reference = 0
This enables the system to prioritize active-power exchange between the EV battery and grid while operating near unity power factor under ideal conditions.
Control Quantity | Function |
Id | Active-power-related current component |
Iq | Reactive-power-related current component |
Id reference | Generated by DC-link controller |
Iq reference | Set to approximately zero |
Vd/Vq | Grid-voltage feedforward quantities |
𝐅𝐞𝐞𝐝𝐟𝐨𝐫𝐰𝐚𝐫𝐝 𝐃𝐞𝐜𝐨𝐮𝐩𝐥𝐢𝐧𝐠 𝐂𝐨𝐧𝐭𝐫𝐨𝐥
The d-axis and q-axis currents are naturally coupled through the grid-interface inductance.
Feedforward decoupling is included to improve current-controller performance.
The control structure uses:
Grid voltage feedforward
d-axis current information
q-axis current information
Grid angular frequency
Filter inductance information
This helps achieve:
Faster current response
Better d-q axis decoupling
Reduced interaction between active and reactive current loops
Improved transient response
More stable grid-current regulation
𝐝𝐪-𝐭𝐨-𝐚𝐛𝐜 𝐂𝐨𝐧𝐯𝐞𝐫𝐬𝐢𝐨𝐧
After the d-axis and q-axis voltage commands are generated, they are transformed back into three-phase reference signals.
The sequence is:
dq control voltage → inverse transformation → abc voltage references → PWM generator → six gate pulses
These six switching pulses control the three-phase Universal Bridge.
𝐕𝟐𝐆 𝐚𝐧𝐝 𝐆𝟐𝐕 𝐎𝐩𝐞𝐫𝐚𝐭𝐢𝐧𝐠 𝐒𝐞𝐪𝐮𝐞𝐧𝐜𝐞
Time | Current Reference | Battery Condition | Power Flow | Operating Mode |
0–1 s | +30 A | Discharging | Battery → Grid | V2G |
At 1 s | +30 A to −30 A | Transition | Direction reversal | Mode Change |
1–2 s | −30 A | Charging | Grid → Battery | G2V |
The transition at 1 second is particularly useful for evaluating the dynamic performance of both control loops.
𝐒𝐢𝐦𝐮𝐥𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
Several important waveforms can be monitored from the MATLAB/Simulink model.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐑𝐞𝐬𝐮𝐥𝐭𝐬
The battery scope displays:
Battery voltage
Battery current
Battery SOC
During V2G:
Current remains close to +30 A.
Battery discharges.
SOC decreases.
During G2V:
Current reverses toward −30 A.
Battery starts charging.
SOC changes its trend accordingly.
𝐁𝐚𝐭𝐭𝐞𝐫𝐲 𝐂𝐮𝐫𝐫𝐞𝐧𝐭 𝐓𝐫𝐚𝐧𝐬𝐢𝐭𝐢𝐨𝐧
At approximately 1 second, battery current changes from:
Before 1 s | After 1 s |
+30 A | −30 A |
Discharging | Charging |
V2G | G2V |
A short transient can be observed around the switching instant as the current controller changes the direction of converter power flow.
𝐆𝐫𝐢𝐝 𝐕𝐨𝐥𝐭𝐚𝐠𝐞 𝐚𝐧𝐝 𝐂𝐮𝐫𝐫𝐞𝐧𝐭
Grid voltage and current provide a clear indication of the change in power-flow direction.
During V2G
The voltage-current phase relationship corresponds to active-power export toward the grid under the selected measurement convention.
During G2V
After the mode transition, the current reverses relative to the grid-voltage reference, indicating active-power import from the grid.
This reversal confirms successful bidirectional grid operation.
𝐀𝐜𝐭𝐢𝐯𝐞 𝐚𝐧𝐝 𝐑𝐞𝐚𝐜𝐭𝐢𝐯𝐞 𝐏𝐨𝐰𝐞𝐫
The model monitors active and reactive power at both:
Converter side
Grid side
At the transition around 1 second, the active-power sign changes.
This demonstrates that the power-flow direction has reversed.
Condition | Active-Power Behavior |
V2G | EV exports energy toward the grid |
Transition | Power crosses through the reversal region |
G2V | Grid supplies energy to the EV |
The reactive-power component remains comparatively controlled because the q-axis reference is maintained around zero.
𝐏𝐨𝐰𝐞𝐫 𝐅𝐥𝐨𝐰 𝐒𝐮𝐦𝐦𝐚𝐫𝐲
𝐕𝟐𝐆 𝐌𝐨𝐝𝐞
EV Battery → DC-DC Converter → DC Link → Grid Converter → LCL Filter → Utility Grid
Key indication:
Battery discharging + active-power export
𝐆𝟐𝐕 𝐌𝐨𝐝𝐞
Utility Grid → LCL Filter → Grid Converter → DC Link → DC-DC Converter → EV Battery
Key indication:
Battery charging + active-power import
𝐊𝐞𝐲 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬
🔋 Bidirectional EV battery charging and discharging
⚡ V2G and G2V operation in a single model
🔄 Automatic power-flow reversal
🌐 Three-phase grid integration
🔌 Bidirectional DC-DC converter
⚙️ IGBT-based Universal Bridge
📈 Battery current regulation
🔋 Battery SOC monitoring
🎯 1000 V DC-link regulation
🔁 Cascaded voltage-current control
🧭 PLL-based grid synchronization
📊 dq synchronous-reference-frame control
🎛️ Feedforward decoupling
⚡ Active and reactive power measurement
🌊 LCL filtering
📉 Transient analysis during mode switching
💻 MATLAB/Simulink implementation
𝐖𝐡𝐲 𝐈𝐬 𝐁𝐢𝐝𝐢𝐫𝐞𝐜𝐭𝐢𝐨𝐧𝐚𝐥 𝐄𝐕 𝐂𝐡𝐚𝐫𝐠𝐢𝐧𝐠 𝐈𝐦𝐩𝐨𝐫𝐭𝐚𝐧𝐭?
Conventional EV chargers normally transfer energy only from the grid to the battery.
Bidirectional charging provides an additional capability: stored EV battery energy can also be returned to the electrical network when required.
Potential benefits include:
Peak-demand support
Renewable-energy balancing
Distributed energy storage
Grid frequency support
Demand-response operation
Energy management
Reduction of peak grid loading
Better utilization of parked EV batteries
𝐀𝐩𝐩𝐥𝐢𝐜𝐚𝐭𝐢𝐨𝐧𝐬
This MATLAB/Simulink model is useful for studying:
Vehicle-to-Grid charging systems
Grid-to-Vehicle charging systems
Smart EV charging
Bidirectional EV chargers
Smart-grid energy management
EV battery energy storage
Grid-connected power converters
dq current control
DC-link voltage regulation
PLL synchronization
Active/reactive power control
Renewable-energy-assisted EV charging
Microgrid EV integration
Vehicle-integrated energy storage
Grid-supporting EV charging infrastructure
𝐖𝐡𝐨 𝐂𝐚𝐧 𝐋𝐞𝐚𝐫𝐧 𝐅𝐫𝐨𝐦 𝐓𝐡𝐢𝐬 𝐌𝐨𝐝𝐞𝐥?
The model is suitable for:
Electrical engineering students
Power electronics learners
EV researchers
Smart-grid researchers
Control-system engineers
Power-system engineers
MATLAB/Simulink users
Engineers working on EV charging infrastructure
It provides a clear example of how battery-side converter control and grid-side vector control work together to achieve controlled bidirectional energy transfer.
𝐂𝐨𝐧𝐜𝐥𝐮𝐬𝐢𝐨𝐧
The MATLAB/Simulink model successfully demonstrates V2G and G2V operation with a three-phase grid and bidirectional DC-DC converter.
The simulation changes the battery current reference from +30 A to −30 A at 1 second, producing a clear transition between vehicle discharging and vehicle charging.
The main control architecture combines:
Bidirectional battery-current control
DC-link voltage regulation
dq current control
PLL synchronization
Feedforward decoupling
Sinusoidal PWM
LCL grid filtering
The battery current, SOC, AC voltage/current, and active/reactive power results clearly demonstrate the reversal of power flow between the EV battery and three-phase utility grid.
This model provides a practical platform for understanding modern bidirectional EV charging, smart-grid interaction, converter control, and V2G/G2V energy management using MATLAB/Simulink.



Comments