convert the Ti example to simulink

4 次查看(过去 30 天)
Hi, i am using the Ti Single-Phase Inverter Reference Design with F2837x MCU .Ti provides the Ti example code and i was wondering if it is possible to convert it to the matlab simulink .
Thank you.

回答(1 个)

Darshan Pandit
Darshan Pandit 2019-12-11
Hi Raymond,
At present, we do not have any utility to convert an existing c-code (such as the mentioned TI-examples) directly into a Simulink model.
What is possible, however, is to build the entire control system specified in Pages 11, 23 & 29 of the user guide shown below. This requires familiarity with concepts of power electronics and some time plus efforts.
ControlScheme.JPG
Once you successfully create the model, then it is possible to generate c-code using Embedded Coder support pacakge for TI f2837XS and f2837XD processors. Also, couple of TI examples are already available as Simulink models for different applications: All C2000 examples, 1-ph inverter, 3-ph inverter.
The existing example for specified application (grid connected 1-ph inverter) is not present yet. Until the required example comes up, you may have a look at entries in file exchange.
  2 个评论
raymond lam
raymond lam 2019-12-11
Thanks for you prompt reply.Now i have a new algorthim to determine the invIoRef and I am able to put the code on the c2000 cpu2.May i know if there is any quick way to put this invIoRef on the original Ti code.
Thanks for you help
Darshan Pandit
Darshan Pandit 2019-12-11
Yes it is possible.
There are multiple ways:
  1. Communicate the invIoRef from cpu2 to cpu1.
  2. Manually integrate the c-code.
For the first one, you may use IPC module of c2837xD targets. Assuming that you are able to generate the code for new alogrithm via Embedded Coder for CPU2, you may make use of the models available here and here. If the update rate is not too high, then you can also make use of Serial or SPI communications. Please note that the origianal TI code needs to be manually updated to facilitate IPC/SCI or SPI communications. TI provides examples like this to facilitate the same. However, this would be a manual process for now.
For the second case, you'd need to understand the interfacing of the c-code via functions. There is a way to do this. This video touches on the topic for Embedded Coder, while this one talks about MATLAB coder. Going forward in this direction, I require more clarity from you on the objectives you are trying to achieve, and also the system in place (whether you have your algorithm in m-script or Simulink model or c-code etc.).

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by