Download Print this page

Advertisement

Quick Links

Hands on Introduction to PLECS TI C2000 Code Genera-
tion
Tutorial Version 1.0
Request a PLECS and PLECS Coder trial license
Get the latest TI C2000 and RT Box Target Support Package
Check the PLECS, RT Box and TI C2000 TSP documentation
Embedded
Code Generation
Tutorial
www.plexim.com

Advertisement

loading
Need help?

Need help?

Do you have a question about the PLECS TI C2000 and is the answer not in the manual?

Questions and answers

Summary of Contents for Plexim PLECS TI C2000

  • Page 1 Embedded Code Generation Tutorial Hands on Introduction to PLECS TI C2000 Code Genera- tion Tutorial Version 1.0 www.plexim.com Request a PLECS and PLECS Coder trial license Get the latest TI C2000 and RT Box Target Support Package Check the PLECS, RT Box and TI C2000 TSP documentation...
  • Page 2 Hands on Introduction to PLECS TI C2000 Code Generation 1 Introduction In this tutorial you will learn about the major functional blocks of the PLECS embedded code genera- tion tool for the Texas Instruments (TI) C2000 processor family. TI C2000 microcontrollers (MCUs) are purpose built for real-time power electronics control.
  • Page 3: Pwm Output

    Hands on Introduction to PLECS TI C2000 Code Generation Fig. 2 for a simple approach. Please note that the Digital Out block should be taken from the TI C2000 Target library. Configure the Digital output GPIO number(s) parameter of the Digital Out block to After finishing the schematic, enter the following line of code in the Model initialization commands window found in the Initialization tab of the Simulation + Simulation parameters...
  • Page 4 Hands on Introduction to PLECS TI C2000 Code Generation 5 When the upload is finished, you can connect the MCU to the host PC from the External Mode tab of the Coder Options window. First, click the button next to the Target device field. Select the appropriate Device type, then click the Scan button to see the available devices.
  • Page 5: Adc Sampling

    Hands on Introduction to PLECS TI C2000 Code Generation L: 1e-4 Capture channel: [0 1] C: 10e-3 R: 1 Scope V: 24 Figure 4: HIL simulation model of a buck converter 2 From the System list of the Coder Options window, select “Plant”. 3 From the General tab enter into the Discretization step size field.
  • Page 6 Hands on Introduction to PLECS TI C2000 Code Generation Digital Delay Task Scope Figure 5: Controller model with ADC block added 2 Drag an Analog Out block from the PLECS RT Box library into the “Plant” subsystem, rename it as “Isw” and connect its input port to the Ammeter.
  • Page 7 Hands on Introduction to PLECS TI C2000 Code Generation Note: In an MCU, the PWM signal is typically generated by comparing the duty cycle (mod- ulation index) to a carrier wave. When the modulation index is greater than the carrier, the MCU turns on the high side switch and turns off the low side switch, which makes the induc- tor current increase in a buck converter.
  • Page 8: Closed-Loop Control

    Hands on Introduction to PLECS TI C2000 Code Generation Digital Delay Task Scope Control Task Trigger Figure 8: Configure the ADC sampling and control task execution Scope − Task Saturation Control Task Trigger Iref Digital Delay Figure 9: Controller subsystem with closed-loop PI regulator for current control 6 Closed-Loop Control In this exercise we will configure a closed-loop current controller for the buck converter.
  • Page 9 Hands on Introduction to PLECS TI C2000 Code Generation Before we upload the modified controller model onto the MCU, an offline simulation could help to pre- verify the performance of the controller. Start a simulation and observe the circuit response, where the waveforms in the scope in the “Controller”...
  • Page 10 Hands on Introduction to PLECS TI C2000 Code Generation References [1] TI C2000 Target Support User Manual, Plexim GmbH, Online: https://www.plexim.com/sites/default/files/c2000manual.pdf [2] Texas Instruments, “LAUNCHXL-F28069M Overview” User’s Guide, SPRUI11B, 2019. [3] RT Box User Manual, Plexim GmbH, Online: https://www.plexim.com/sites/default/files/rtboxmanual.pdf [4] RT Box LaunchPad Interface Board, Plexim GmbH, Online: https://www.plexim.com/sites/default/files/launchpadinterfacemanual.pdf...
  • Page 11 Plexim GmbH. PLECS is a registered trademark of Plexim GmbH. MATLAB, Simulink and Simulink Coder are regis- tered trademarks of The MathWorks, Inc. Other product or brand names are trademarks or registered...