0
0
Signal-processingHow-ToBeginner · 4 min read

How to Simulate EV Battery in Simulink: Step-by-Step Guide

To simulate an EV battery in Simulink, use the Battery block from the Simscape Electrical library, configure its parameters like capacity and voltage, and connect it to your EV model. This allows you to analyze battery behavior under different load and charging conditions.
📐

Syntax

The main component to simulate an EV battery in Simulink is the Battery block found in the Simscape > Electrical > Sources library. You configure parameters such as:

  • Nominal Voltage: The rated voltage of the battery.
  • Capacity: The total charge the battery can hold, usually in Ampere-hours (Ah).
  • Initial State of Charge (SOC): The starting charge level as a percentage.
  • Internal Resistance: Represents battery losses.

These parameters define how the battery behaves during simulation.

signal_processing
Battery Block Parameters:
- Nominal Voltage: 400 V
- Capacity: 100 Ah
- Initial SOC: 80%
- Internal Resistance: 0.01 Ohm
💻

Example

This example shows how to set up a simple EV battery simulation using Simulink's Battery block connected to a load resistor to observe voltage and current behavior.

plaintext
1. Open Simulink and create a new model.
2. From Simscape > Electrical > Sources, drag the <Battery> block into the model.
3. Set the Battery parameters:
   - Nominal Voltage: 400
   - Capacity: 100
   - Initial SOC: 80
   - Internal Resistance: 0.01
4. Add a <Resistor> block from Simscape > Electrical > Elements and set resistance to 5 Ohms.
5. Connect the Battery positive terminal to the Resistor, and the Resistor back to Battery negative terminal.
6. Add <Voltage Sensor> and <Current Sensor> blocks to measure battery output.
7. Connect sensors to <Simulink-PS Converter> blocks and then to <Scope> blocks to visualize voltage and current.
8. Run the simulation for 100 seconds.

This setup simulates battery discharge through a resistor load.
Output
Simulation runs showing voltage dropping gradually from 400 V as current flows through the resistor, and current decreasing as battery discharges.
⚠️

Common Pitfalls

Common mistakes when simulating EV batteries in Simulink include:

  • Incorrect parameter units: Always ensure capacity is in Ah and voltage in Volts.
  • Ignoring initial SOC: Starting with 0% SOC will show no battery output.
  • Not including internal resistance: This leads to unrealistic battery behavior with no voltage drop under load.
  • Improper connections: Battery terminals must be connected correctly to avoid simulation errors.

Always validate your model with simple loads before adding complexity.

plaintext
Wrong way:
- Battery initial SOC = 0%
- No internal resistance set

Right way:
- Battery initial SOC = 80%
- Internal resistance = 0.01 Ohm
📊

Quick Reference

ParameterDescriptionTypical Value
Nominal VoltageRated voltage of the battery300-400 V
CapacityTotal charge battery can hold50-100 Ah
Initial SOCStarting charge level (%)20-100%
Internal ResistanceBattery's internal loss resistance0.005-0.02 Ohm

Key Takeaways

Use the Simscape Electrical Battery block to simulate EV batteries accurately.
Set correct parameters like nominal voltage, capacity, initial SOC, and internal resistance.
Connect battery terminals properly and validate with simple loads first.
Monitor voltage and current using sensors and scopes for analysis.
Avoid zero initial SOC and missing internal resistance to prevent unrealistic results.