Do we have a standard procedure to convert SIMULINK model to HDL code?

3 views (last 30 days)
Heema Dave
Heema Dave on 22 Mar 2022
Commented: Kiran Kintali on 14 Apr 2022
I have developed a SIMULINK model of IPMSM based drive that uses FOC logic for torque control.
I want to convert the model to HDL code.

Answers (2)

Steven Lord
Steven Lord on 22 Mar 2022
Do you have HDL Coder licensed and installed? If so see the documentation and the examples link on that documentation page.

Kiran Kintali
Kiran Kintali on 22 Mar 2022
Edited: Kiran Kintali on 22 Mar 2022
  2 Comments
Kiran Kintali
Kiran Kintali on 14 Apr 2022
As the model is single rate user can set target clk frequency as 100MHz and then set oversampling factor to 2000 so the generated HDL code gets a clock enable at 50KHz allowing the model to still run at 50KHz with a target frequency of 100MHz
Setting target frequency of 100MHz and Oversampling of 2000 creates a timing controller that takes care of running FOC at desired frequency of 50 KHz,
You can look at the timing controller code that gets generated based on the Target frequency and oversampling setting.
(some useful references on these topics)

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!