MC9S12ZVML128_LIN_BLDC_Sensorless code

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MC9S12ZVML128_LIN_BLDC_Sensorless code

ソリューションへジャンプ
1,725件の閲覧回数
itsnewforme
Contributor IV

Hii, I'm using the code MC9S12ZVML128_LIN_BLDC_Sensorless for S12ZVML. I've flashed the code on the microcontroller and after running the code the motor rotates with 1500 rpm. How do I change the speed of the motor in the code ?

0 件の賞賛
返信
1 解決策
1,706件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

There is a FreeMaster variable requiredSpeeed which is connected to a variable with the same name in the project - requireSpeed. You can find any suitable place or event to modify the variable on  your demand but you have to add the variable in correct way because it is transformed ti signed fractional arithmetic. In other words the value has to be added in fractional form if it is modified in the code.

 

This is a screensho of inserting variable via FreeMaster and connection to real variable in the application SW in the MCU.

lama_0-1659517054338.png

... and function where to do it.

For example in the main loop int the function void main(void)

If you study the code then you see that the variable is checked and updated in the periodic intervals (INTERRUPT void TIMchan3_ISR(void)) and then entered into control loop with another name.

 

Best regards,

Ladislav

元の投稿で解決策を見る

3 返答(返信)
1,719件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

Hi,

You have to have installed FreeMaster and then … it is described in the application control part in  https://www.nxp.com/docs/en/user-guide/MTRCKTSBNZVM128QSG.pdf

 

Best regards,

Ladislav

0 件の賞賛
返信
1,717件の閲覧回数
itsnewforme
Contributor IV

Is it possible to do it without using FreeMaster, by directly changing the values in code. If so, please let me know where ?

0 件の賞賛
返信
1,707件の閲覧回数
lama
NXP TechSupport
NXP TechSupport

There is a FreeMaster variable requiredSpeeed which is connected to a variable with the same name in the project - requireSpeed. You can find any suitable place or event to modify the variable on  your demand but you have to add the variable in correct way because it is transformed ti signed fractional arithmetic. In other words the value has to be added in fractional form if it is modified in the code.

 

This is a screensho of inserting variable via FreeMaster and connection to real variable in the application SW in the MCU.

lama_0-1659517054338.png

... and function where to do it.

For example in the main loop int the function void main(void)

If you study the code then you see that the variable is checked and updated in the periodic intervals (INTERRUPT void TIMchan3_ISR(void)) and then entered into control loop with another name.

 

Best regards,

Ladislav