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.
解決済! 解決策の投稿を見る。
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 ?
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
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 ?
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
Hi,,Daniel
I understand. Thanks very much