Skip to main content
emobility.academy
B.Tech / BEPower electronicsIntermediate About 6 weeksMATLAB & Simulink

Bidirectional DC–DC Converter Between Battery and DC Link

Model a bidirectional synchronous half-bridge DC–DC converter between a battery and a higher-voltage DC link, with cascaded current and voltage control. Test boost-mode motoring, buck-mode regeneration and seamless mode transitions under load steps.

Tools: Simulink · Simscape Electrical

Bidirectional DC–DC Converter Between Battery and DC Link: EV charger (EVSE) trainer demonstration at DIYguru
Representative photo from DIYguru's EV lab, not of this specific project.

The problem

Some EV and hybrid architectures place a DC–DC converter between the battery and the inverter so that the DC link can run at a higher, regulated voltage. The converter must carry power both ways, boosting for motoring and bucking for regenerative braking, without disturbing the DC link during sudden changes. Getting this control right is central to these architectures and to battery–supercapacitor hybrid storage.

Objectives

  • Size a synchronous half-bridge converter for bidirectional power flow.
  • Model a battery source and a DC link with motoring and regenerating loads.
  • Design an inner inductor-current loop and an outer DC-link voltage loop.
  • Test motoring, regeneration and transitions between them.
  • Estimate efficiency in both directions.

What you need

Tools and toolboxes

  • Simulink — Cascaded controllers, PWM, test sequences and logging.
  • Simscape Electrical — MOSFETs, inductor, capacitors, Battery block and controlled current source for the load.
  • Control System Toolbox — Optional: loop design on the averaged model. Hand calculations are enough for a basic design.

Software

  • MATLAB R2023b or later
  • Simulink
  • Simscape Electrical

Extra parts and data

None beyond the software above.

Key concepts

Synchronous half-bridge
Two complementary switches and an inductor: driving the low-side switch gives boost from battery to DC link; driving the high-side gives buck from DC link to battery. With complementary gating the same circuit does both.
Cascaded control
A fast inner loop controls inductor current, which equals battery current; a slower outer loop sets the current reference to hold the DC-link voltage.
Seamless transition
With complementary switching, inductor current can pass smoothly through zero, so the converter changes direction without a mode switch.
Dead time
A short interval when both switches are off, preventing shoot-through; it causes small voltage errors and must be included in a realistic model.

Step-by-step guide

  1. 1

    Set example specifications

    Choose labelled example values: a 48 V battery (40–54 V across SOC), a 100 V DC link, 3 kW in both directions, 50 kHz switching. Specify DC-link voltage deviation below 5 per cent for a full-power step from motoring to regeneration, and recovery within 5 ms. State the battery current limits in charge and discharge. These values are for the study only, not a product design.

    Checkpoint: A specification table including power, voltages, switching frequency and transient limits.

  2. 2

    Size the inductor and capacitors

    Compute duty range from D = 1 − Vbat/Vdc for boost, inductance for a chosen current ripple (for example 30 per cent of rated battery current) at the worst-case duty, and DC-link capacitance from the allowed ripple and from the energy needed during the load step. Write all calculations into a script. Check also the inductor peak current against a candidate part's saturation rating at full power.

    Checkpoint: Script outputs L, C and predicted ripple at the extremes of battery voltage.

  3. 3

    Build the power stage

    Build the half-bridge with two Simscape Electrical MOSFETs with body diodes, the inductor with resistance and the DC-link capacitor. Use the Simscape Electrical Battery block on the low side with example capacity and internal resistance, and a Controlled Current Source on the DC link to represent the inverter: positive for motoring and negative for regeneration. Include dead time of, for example, 200 ns.

    Checkpoint: With fixed complementary duty, the DC link settles near Vbat/(1 − D) and current flows in the direction set by the load.

  4. 4

    Design the current loop

    From the averaged model, the duty-to-inductor-current transfer function is approximately Vdc/(L·s) at the frequencies of interest. Design a PI controller for a bandwidth around one tenth of the switching frequency. Implement it with duty limits and anti-windup, and test current reference steps in both directions with the DC link held by a voltage source. Check that dead time does not distort current near zero crossing.

    Checkpoint: Current steps from −50 A to +50 A track with the designed rise time and pass through zero without distortion.

  5. 5

    Design the voltage loop

    Replace the DC-link source with the capacitor and current-source load and design an outer PI loop on DC-link voltage with bandwidth around one tenth of the current loop. Add feed-forward of load power divided by battery voltage to the current reference to improve the transient response. Limit the current reference to the battery's charge and discharge limits. Verify the loop margins at both minimum and maximum battery voltage.

    Checkpoint: DC-link voltage settles at 100 V within a few milliseconds of a load step.

  6. 6

    Test motoring, regeneration and transitions

    Run a sequence: motoring at full power, a step to zero, a step to full regeneration, and a direct reversal from full motoring to full regeneration. Log DC-link voltage, inductor current and battery current. Compare results with and without feed-forward. Script the sequence with a Signal Editor block so that it is identical for every run, and mark each event on the plots so readers can match transients to their causes.

    Checkpoint: DC-link deviation stays within 5 per cent during the full reversal, with feed-forward reducing it noticeably.

  7. 7

    Check limits and battery effects

    Repeat the tests at minimum and maximum battery voltage. Test what happens when regeneration demand exceeds the battery charging current limit: the voltage loop must saturate and the DC link will rise, so add a brake-chopper threshold or a signal back to the drive. Log how the system behaves. Treat the over-voltage case seriously, since in a real vehicle an uncontrolled DC-link rise could damage the inverter, and show that your chosen protection keeps the voltage within a safe band.

    Checkpoint: Behaviour at the limits is documented, including the case where regeneration exceeds the charge limit.

  8. 8

    Estimate efficiency and report

    Estimate MOSFET conduction and switching losses and inductor copper loss with example datasheet values in both directions over a range of power. Plot efficiency against power for boost and buck operation. Write up sizing, control design, transient tests, limit cases and efficiency, with model assumptions. Compare the measured efficiency curves with the loss breakdown so that a reader can see which component dominates at light and full load, and suggest which part to improve first.

    Checkpoint: Efficiency curves for both directions and a report reproducible from scripts.

Testing & validation

  • Steady-state voltage ratio matches theory in both directions.
  • Current loop tracks bidirectional steps through zero.
  • DC-link voltage deviation within spec on full reversal.
  • Behaviour at battery voltage and current limits documented.
  • Efficiency estimated in both directions.

Expected results

A bidirectional DC–DC converter model with cascaded control that holds the DC link through motoring, regeneration and full power reversals, with documented limit behaviour and efficiency.

Take it further

  • Interleave two phases and measure the reduction in input ripple.
  • Add a supercapacitor branch and share transient power between it and the battery.
  • Feed the DC-link current from a drive-cycle vehicle model.
  • Compare average current control with peak current control.

Viva and review questions

How does the converter change direction without a mode switch?

With complementary switching, inductor current is free to go positive or negative; the current controller simply moves the duty and current passes through zero smoothly.

Why use a cascaded structure?

The inner loop controls and limits current quickly, protecting the battery and switches, while the slower outer loop regulates DC-link voltage through that current.

What does feed-forward add?

It sets the current reference directly from the load power, so the voltage loop only corrects the small remaining error and the DC link dips much less on a load step.

Learn it at DIYguru

These DIYguru courses and programmes teach what this project needs.

Related EV projects

All 100 MATLAB & Simulink EV projects