> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hyperlab/example-models/power-electronics/buck-boost-converter.md).

# Buck-Boost Converter

## Description

A DC/DC Buck-Boost Converter is a power electronic circuit designed to convert a DC input voltage into a higher or lower DC output voltage. This conversion is achieved by temporarily storing energy in an inductor and transferring it to the load through a controlled switching process.

The converter uses a transistor driven by a Pulse Width Modulation (PWM) signal to regulate energy transfer. By adjusting the **duty cycle** of the PWM signal, users can control the magnitude of the output voltage while maintaining a constant input voltage.

Unlike conventional buck or boost converters, the buck-boost topology can operate in both step-down and step-up modes, depending on the selected duty cycle.

## Requirements

This example does not require any additional resources.

## Detailed explanation

This example allows users to investigate the dynamic behavior of a DC/DC Buck-Boost Converter by modifying the PWM duty cycle and switching frequency in real time.

The input voltage is fixed at **50 V DC**, while the duty cycle can be adjusted between **20% and 80%** and the switching frequency between **2 kHz and 20 kHz**.

The interactive interface provides a circuit schematic, adjustable control parameters, voltage measurements, and a real-time graph displaying:

* **Input voltage (v\_src):** The constant DC supply voltage.
* **Output voltage (v\_R):** The voltage measured across the load resistor, displayed according to the measurement polarity.

<figure><img src="https://2712201518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbs0l9jugXixa0ghErrqs%2Fuploads%2F9ou9dz8QlZMGT1q5PE1D%2Fbuck-boost-converter.png?alt=media&amp;token=95a46cf3-73bd-4b7d-a848-62cbd8aeeca0" alt=""><figcaption></figcaption></figure>

## Simulation and results

#### **Experiment 1 – Transition Between Buck and Boost Modes**

Start with a duty cycle of 20% and gradually increase it to 80%.

Observe how the output voltage magnitude changes as the transistor remains ON for a larger proportion of each switching period.

Compare the measured output voltage with the theoretical values predicted by the ideal buck-boost converter equation.

#### **Experiment 2 – Dynamic Response**

Apply sudden changes in the PWM duty cycle and observe the transient response of the output voltage.

Notice how the output voltage transitions between different steady-state levels. The inductor and output capacitor influence the time required for the voltage to stabilize.

Pay particular attention to the response when switching between buck and boost operating regions.

#### **Experiment 3 – Influence of Switching Frequency**

Keep the duty cycle constant and progressively reduce the switching frequency from 20 kHz to 2 kHz.

Observe how the output voltage ripple changes. Lower switching frequencies generally produce larger inductor current variations and increased output voltage ripple for the same inductor and capacitor values.

Compare the voltage waveforms at different switching frequencies to understand the role of energy-storage components in smoothing the output voltage.

## Other variations for this example

### External PWM Control Using a TI C2000 Controller

This example is also available in a version featuring **external PWM control using a Texas Instruments TI C2000 microcontroller**. In this configuration, the PWM signal is generated by the external controller rather than within the simulation model. The signal is acquired by the real-time simulator through a **digital input** and then used to drive the IGBT switching device.

This configuration enables **Hardware-in-the-Loop (HIL) testing**, allowing users to evaluate the interaction between a real embedded controller and a simulated power electronic circuit.

### Closed-Loop Control Using a PI Controller

This example is also available in a **closed-loop control configuration**, where the PWM signal is generated by a **Proportional-Integral (PI) controller** to automatically regulate the system output according to a reference value.

Two variants are available:

* **Simulated PI Controller:** The PI controller is implemented directly within the simulation model, allowing users to explore closed-loop control behavior and tune the controller parameters.
* **External PI Controller (TI C2000):** The PI controller is implemented on a Texas Instruments TI C2000 microcontroller. The controller generates the PWM signal, which is acquired by the real-time simulator through a digital input to drive the IGBT.

These two configurations enable users to compare **fully simulated closed-loop control with Hardware-in-the-Loop (HIL) implementation**, providing a practical approach to control algorithm development, validation, and testing.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hyperlab/example-models/power-electronics/buck-boost-converter.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
