MATLAB Examples

DC/DC Buck Converter

This example shows how to design a DC/DC Buck Converter controller with the Embedded Coder Support Package for TI® C2000 Processors and run it on the TI® F28377S Launchpad connected to the C2000 DPS BoosterPack. You can monitor signal and tune parameters using the provided host model running on your host computer.

Contents

Required Hardware

Available Models

Model configuration

You have to adjust the host model c2000_host_read_12M.slx to match the COM port of your system.

To find the COM port of your F28377S Launchpad, look in the "Ports (COM & LPT)" section of the device manager of your computer.

Refer to the following page for more information on using the serial connection for your hardware: http://processors.wiki.ti.com/index.php/Using_the_serial_adapter_of_XDS100

Once you have found the right COM port, you have to update the following blocks:

  • c2000_host_read_12M/Serial Configuration
  • c2000_host_read_12M/Serial Receive
  • c2000_host_read_12M/Serial Send/Serial Send

Run the Example

  • Open the target model f28377S_DCDC_Buck.slx and generate code by typing Ctrl+B. Follow the build process by opening the diagnostic viewer with the link provided at the bottom of the model canvas. Once the code is loaded on the board, a blue LED blinks at a period of 1 second on the LaunchPad indicating that the code is properly running.
  • Open the host model c2000_host_read_12M.slx. Make sure that your COM port is properly configured following the model configuration instructions. Click on the play button to run the model.

Monitor Signals

While the host model is running, the following signals can be monitored on the scope:

  1. I_FB Current: The current flowing in the load resistors. Raw values are displayed to allow real-time logging. 4095 counts > 3.3A
  2. V_FB Voltage: The measured output voltage of the system. 4095 counts > 6.8V

Tune Parameters

While the host model is running, you can tune parameters that will be sent to the hardware using the following dashboard blocks:

  1. Voltage Request: Change the output voltage demand. This parameter is the main request for the control loop. The controller algorithm will compare this value with the measured output voltage and adjust the PWM duty cycle to towards achieving that output voltage.
  2. Active load: Turn on and off the active load present on the hardware. This parameter allows you to add an extra load resistor to study the effect of abrupt changes in the load circuit.
  3. P Gain: Change the proportional gain of the controller algorithm. You can change this parameter to study the robustness of the controller. Aggressive changes may lead to instability of the controller, apply changes wisely.
  4. I Gain: Change the integral gain of the controller algorithm. You can change this parameter to study the robustness of the controller. Aggressive changes may lead to instability of the controller, apply changes wisely.

Summary

This example introduced the workflow for generating code and tuning the power conversion applictions using Embedded Coder Support Package for Texas Instruments TI C2000 Processors.