convert the Ti example to simulink
4 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Darshan Pandit
on 11 Dec 2019
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.
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 Comments
Darshan Pandit
on 11 Dec 2019
Yes it is possible.
There are multiple ways:
- Communicate the invIoRef from cpu2 to cpu1.
- 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.).
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!