> 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-converter.md).

# Buck Converter

## Description

A DC/DC Buck Converter is a power electronic circuit designed to reduce a DC input voltage to a lower DC output voltage. This conversion is achieved by controlling the flow of energy through a switching transistor and an inductor.

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

## 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 Converter by modifying the PWM duty cycle and switching frequency in real time.

The input voltage is fixed at **24 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.

<figure><img src="https://2712201518-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fbs0l9jugXixa0ghErrqs%2Fuploads%2FE2ulGvK4PZXZEhgnIbpi%2Fbuck-converter.png?alt=media&amp;token=884bc468-ac73-48c6-a971-a68ffda8fb33" alt=""><figcaption></figcaption></figure>

## Simulation and results

#### **Experiment 1 – Influence of the Duty Cycle**

Start with a duty cycle of 20% and gradually increase it to 80%. Observe how the output voltage increases 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 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 speed and smoothness of these transitions.

#### **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.

## 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.


---

# 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-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.
