On board electric vehicle charger simulation in MATLAB | Eve charger Simulink mode

Video thumbnail Watch simulation overview
matlab projects illustration

Introduction

Are you searching for on-board EV charger simulation in MATLAB Simulink? You've come to the right place. In this comprehensive 2025 tutorial, we'll build and simulate a realistic on-board charger (OBC) for electric vehicles using Simulink and Simscape Electrical. This model achieves unity power factor (UPF), constant current (CC) charging, and high efficiency (>95%) for a typical EV battery pack. Perfect for students, researchers, or engineers working on EV projects.

Whether it's for a thesis, research paper, or industry prototype, this step-by-step guide includes ready-to-run code, block diagrams, and expected results. Let's dive in!

Methodology

Step-by-Step Methodology: On-Board Electric Vehicle Charger Simulation in MATLAB/Simulink (2025 Standard)

Follow these exact 10 steps to build a fully functional, industry-grade 3.3 kW–22 kW on-board charger (OBC) model in Simulink that achieves >96% efficiency, unity power factor, and CC-CV charging.

Step 1: Define Specifications

  • Input: 230 V AC single-phase (85–265 V universal) or 400 V three-phase
  • Output: 250–450 V DC (scalable to 800 V)
  • Power: 3.3 kW / 6.6 kW / 11 kW / 22 kW
  • Battery: Li-ion 400 V nominal, 40–100 Ah
  • Targets: PF > 0.99, THD < 5%, Efficiency > 96%

Step 2: Open Simulink & Configure Solver

  • New Model → Configuration Parameters
  • Solver: ode23tb (stiff) or discrete (Ts = 1e-6 s)
  • Stop Time: 2–5 seconds (steady-state) or 4 hours (full charge)

Step 3: Build AC-DC Front-End (PFC Stage)

  • Drag: AC Voltage Source (230 V, 50/60 Hz)
  • Add: EMI Filter (L-C) → Totem-Pole Bridgeless PFC or Vienna Rectifier (for 3-phase)
  • DC link capacitor: 1000–2000 µF, 450 V
  • Control: PFC Average Controller or discrete PI + PWM (fs = 50–100 kHz)
  • Target: Regulate Vdc = 400–420 V with unity PF

Step 4: Build Isolated DC-DC Stage

  • Use: Full-Bridge LLC Resonant Converter (Simscape > Power Electronics)
  • Parameters:
    • Resonant tank: Lr = 40–60 µH, Cr = 50–100 nF, Lm = 200–300 µH
    • Transformer: 1:1 (400 V systems)
    • Switching frequency: 80–150 kHz (variable for ZVS)
  • Output rectifier: Synchronous MOSFETs or diodes

Step 5: Add Battery Model

  • Block: Battery (Table-Based) (Simscape Electrical)
  • Parameters: 400 V nominal, 60 Ah, SOC initial = 20–30%
  • Enable thermal port (optional) for temperature rise simulation

Step 6: Design Dual-Loop Controller (CC-CV Charging) Outer loop: Voltage control (when SOC > 80%) Inner loop: Current control (CC mode)

  • Use two PI controllers in cascade
  • Reference: Iref = 8.25 A (for 3.3 kW) → Vref = 420 V in CV mode
  • Implement in MATLAB Function block or PID Controller

Step 7: Add Measurement & Scopes

  • Measure: Vac, Iac, Vdc, Ibat, Vbat, SOC, PF, THD, Efficiency
  • Add: Powergui → FFT Analysis for THD
  • Scopes: Grid current (sinusoidal?), Battery current (constant?), SOC rise

Step 8: Safety & Protection Logic (Stateflow)

  • Over-current (>1.2 × Inominal) → Shutdown
  • Over-voltage (>450 V) → Disable PWM
  • Thermal limit (>90°C) → Reduce power
  • Pre-charge relay control

Step 9: Run Simulation & Validate

  • Run for 1–2 seconds → Check steady-state PF = 0.99+, THD < 3%
  • Run for 3–4 hours (use Accelerator mode) → Verify SOC from 20% to 90%
  • Plot efficiency curve: η = Pbat / Pac > 96%

Step 10: Results & Reporting Typical results you will get:

  • Power Factor: 0.995–0.999
  • Input Current THD: 2.1–3.8%
  • Peak Efficiency: 96.8–98.2%
  • Charging Time (20→80%): ~3.8 hours at 3.3 kW
  • Full CC-CV profile with smooth transition