PMSM is programed in FPGA using HDL coder.

조회 수: 5(최근 30일)
Cau Tran
Cau Tran 2022년 6월 10일
댓글: Cau Tran 2022년 8월 1일
Hi everyone,
I am intend to use HDL coder to build PMSM control application. I already saw Matlab's example ( Deploy Motor Control Algorithms to FPGA - Hardware Prototyping) for development this application. But, I have some confuse for this example 's architecturer. I have a question for that one:
  • I don't see any periods for current loop and speed loop. In MCU platform, I usually use 10 kHz for control current loop and 1 kHz for speed loop. But in your example, I don't see anything to synch among subsystems ( speed loop, current loop, pwm, adc)

채택된 답변

Kiran Kintali
Kiran Kintali 2022년 6월 15일
In the motor control demo project the current control algorithm and speed control runs on FPGA and processor respectively and they are modelled using model reference blocks (also known as model blocks).
The current control algorithm is configured to run at 25kHz (40e-6) and speed control algorithm is configured with 1kHz (1e-3), the sampling time for these referenced models is handled using sample time of inport from variable in data dictionary.
In the MODELING tab “ModelExplorer/External Data/focZynqData/Design Data/sampleTime” you can all the sample times configurations in the model
Additionally you can refer to
“'focZynqHdl/FOC_Velocity_Encoder/FOC_Current_Control/FOC_Current_Control/Phase_Current” inport sample time setting in “Execution’ tab.
ADC and PWM modules are available as IP cores in support packages/reference design of the demo, they are designed to be synchronized, and the interfaces to these modules are available in HDL Workflow advisor
  댓글 수: 1
Cau Tran
Cau Tran 2022년 8월 1일
Thanks for your support. But, I am interesting for PWM IP core. I saw the " Debug and Verify FPGA Algorithms with MATLAB and Simulink", I see the "pwm TestBench" file, but I don't find anything related with this one. Can you provide me this file?
Thanks you a lot.

댓글을 달려면 로그인하십시오.

추가 답변(1개)

Kiran Kintali
Kiran Kintali 2022년 6월 10일
Please note that Simulink handles the synchronization for you among the various modules in the model.
I would recommend Simulink onramp and for further guidance on this topic.
Please share sample models you have in mind and challenges if any HDL code generation or deployment onto FPGA/HIL platform.
  댓글 수: 1
Cau Tran
Cau Tran 2022년 6월 14일
I think that Motor Control is a specical application. It request the synchronization between ADC current measurement and PWM module.
Normally, the period of current is same and synch with PWM pulse. And for my experience, the time of speed loop equals 10 times to current loop. But I don't see any relationship between two control loops.
Please share any explaination for your designation.

댓글을 달려면 로그인하십시오.


Find more on Code Generation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by