The mcd_main function generated from S12ZVM_FOC.slx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

The mcd_main function generated from S12ZVM_FOC.slx

跳至解决方案
1,389 次查看
jiangfeng
Contributor III

Hi, Dear Daniel

This is the main function generated from S12ZVM_FOC.slx, however ,I can't find the SYSTEM_TASK() in the while cycle. Should I put the SYSTEM_TASK in the red part or the while loop?

I  have tried to put the SYSTEM_TASK() in the red part or the while loop  ,and then my BLDC didn't work.

Thanks very much.

pastedImage_1.png

标签 (1)
1 解答
1,182 次查看
Daniel_Popa
NXP Employee
NXP Employee

Hi jiangfeng‌,

I'm not sure i've understood your question.

The MBDToolbox generates all the code and setup needed to run the application without the need for any additional hand written code.

That comment is put there in case you want to reuse the generated code for other purposes via an IDE.

By default the code generated by the Matlab is going to place the call to SYSTEM_TASK() within the callback of the TIM_Ch0_ISR interrupt.

Is this what you are looking for ?

pastedImage_1.png

Do not try to call is on the infinite loop. In case you need to use another interrupt source, just call it on that interrupt callback routine since you need a precise timing in order to control the motor.

Hope this helps!

Daniel

在原帖中查看解决方案

2 回复数
1,183 次查看
Daniel_Popa
NXP Employee
NXP Employee

Hi jiangfeng‌,

I'm not sure i've understood your question.

The MBDToolbox generates all the code and setup needed to run the application without the need for any additional hand written code.

That comment is put there in case you want to reuse the generated code for other purposes via an IDE.

By default the code generated by the Matlab is going to place the call to SYSTEM_TASK() within the callback of the TIM_Ch0_ISR interrupt.

Is this what you are looking for ?

pastedImage_1.png

Do not try to call is on the infinite loop. In case you need to use another interrupt source, just call it on that interrupt callback routine since you need a precise timing in order to control the motor.

Hope this helps!

Daniel

1,182 次查看
jiangfeng
Contributor III

Hi,,Daniel

I understand. Thanks  very much

0 项奖励
回复